How Android sets line spacing, row height for TextView

Source: Internet
Author: User

The original from: You I study Web: Link address: http://www.niwoxuexi.com/blog/android/article/222.html

In Android, TextView will be relatively compact and not very beautiful by default when displaying Chinese. In order for each line to maintain a certain line spacing,

You can set properties Android:linespacingextra or Android:linespacingmultiplier.

You can view Android custom view-text wrapping for TextView in Chinese on Android.

1, Android:linespacingextra

Set the line spacing, such as "4DP".

<textview android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:text= "Welcome to you I study net-www . niwoxuexi.com "android:textsize=" 14sp "android:linespacingextra=" 4DP "/>

2, Android:linespacingmultiplier

Sets a multiple of the line spacing, such as "1.2″."

For example:

<textview android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:text= "Welcome to you I study net-www . niwoxuexi.com "android:textsize=" 14SP "android:linespacingmultiplier=" 1.2 "/>


This article is from the "Full stack Development" blog, please be sure to keep this source http://andy2290.blog.51cto.com/13193207/1955572

How Android sets line spacing, row height for TextView

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.