When TextView write numbers, remove the default spacing.

Source: Internet
Author: User

Recently developed the time to meet a very depressed problem when you set a number in the Texview data and the upper and lower TextView the default spacing, after the inspection found that there is no spacing parameters later found on the Internet also asked this question


Someone said to add TextView


Android:includefontpadding= "false"

Yes, but it doesn't seem to have the effect I want.


Finally added the line spacing parameter solved O (∩_∩) o haha ~

    Android:linespacingmultiplier= "0.9"


Learn to feel this and imageview sometimes will be the default white side of the problem as wonderful ~


You can see the effect by adding a contrast chart below.




The first one is what does not set the spacing and distance of the TextView obviously feel the numbers up and down the distance is very large,

The second one is only the data set line spacing linespancingmultiplier= "0.9"

The third is the number and the following units are set over the spacing of the

The fourth one is the number set over Includefontpadding= "false"

The fifth is that both the number and the unit have been set to includefontpadding= "false"

The sixth one is two TextView linespancingmultiplier= "0.9" and includefontpadding= "false" are all set


The effect of the sixth one is ideal for me.

When TextView write numbers, remove the default 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.