black friday sale

Flat 10% off on the purchase of any two apps or more. Use coupon code - FESTIVAL10

Grab It Now
Check Mobile App
Read now
Start a Project

Set Line Spacing in TextView

Save

TextView displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing.

In this blog you will know how to increase the spacing between two lines of TextView.

Just we need to add an attribute with your TextView that give the spacing with lines.

These are –android:lineSpacingExtra, android:lineSpacingMultiplier – use these two attributes with your TextView in XML file.  or Programatically call setter method of that attribute textView.setLineSpacing().

Example-

That set for giving line spacing between lines of TextView.

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


3 comments

  • ZoraGhy
    Thanks!
  • CATawde
    Hello, article is good and helpful.
    I want to know difference between padding and android:lineSpacingExtra.
    Please guide for same.
    • anchit (Moderator)
      Padding –> This will add space only on the four sides of the content.

      android:lineSpacingExtra –> This will actually work well when you have a multi line text to display and will help in adjusting the spacing between the text lines.

      Hope this helps you 🙂

  • css.php

    When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

    Michael Urresta

    Michael Urresta

    Talk to Sales

    Global

    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home