Android TextView sets the font spacing and kerning _android

Source: Internet
Author: User

Word spacing

TextView has a property Android:textscalex is the kerning, and its value is a float type. View source code, default TextView This property is used by:

Android.internal.r.styleable.textview_textscalex
Settextscalex (a.getfloat (attr, 1.0f));

Line spacing

The Android system TextView the default display of Chinese will be more compact, not very beautiful. You can set property Android:linespacingextra or Android:linespacingmultiplier in order for each line to maintain a certain amount of line spacing.

For Android TextView Chinese line wrap problem, you can view the Android custom view-text wrap.

1, Android:linespacingextra

Sets the line spacing, such as "3DP."

2, Android:linespacingmultiplier

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

Reference code:

Android:layout_width= "Fill_parent"
android:layout_height= "wrap_content"
android:linespacingextra= "3DP"
android:linespacingmultiplier= "1.5"
android:textstyle= "bold"/>

Related Article

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.