Android TextView Set Text spacing

Source: Internet
Author: User

Search results are not reliable, basically said that Android:textscalex can set the text spacing, do not know whether you have really done development.

The Android development documentation describes it clearly:

Android:textscalex

Sets the horizontal scaling factor for the text.

This thing is used to set the horizontal direction of the text to zoom in and zoom out.

In fact, setting the text spacing can be achieved by modifying the characters in the string.xml and adding spaces to them.

However, entering a space directly in the string does not achieve the desired effect, which requires escaping with the escape character so that the character is displayed correctly when used.

The usual XML escape characters are recorded as follows:

spaces : <string name= "Out_bound_submit" > Out & #160;& #160; library </string> & #160;

line break : <string name= "Hello_world" > Hello! \ n the world! </string> the \ n means line break

indent : <string name= "Hello_world" > Hello! \ t World! </string> where \ t represents a few spaces that press the TAB key once.

It should be noted that, because the system defines the basic indentation of the number of different, some represent 4 half-width characters, some represent 8 half-width characters, it may be displayed when the effect is different, it is recommended to write the interface as little as possible.

Android TextView Set Text spacing

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.