Add floating point value to android resources/values

后端 未结 10 1944
清酒与你
清酒与你 2020-11-27 10:52

I\'m trying to add a little space between lines to my TextViews using android:lineSpacingMultiplier from the documentation:

Extra spacing

10条回答
  •  无人及你
    2020-11-27 11:21

    I used a style to solve this issue. The official link is here.

    Pretty useful stuff. You make a file to hold your styles (like "styles.xml"), and define them inside it. You then reference the styles in your layout (like "main.xml").

    Here's a sample style that does what you want:

    
    

    Let's say you want to alter a simple TextView with this. In your layout file you'd type:

    
    

    Try it--this is essentially how all the built-in UI is done on the android. And by using styles, you have the option to modify all sorts of other aspects of your Views as well.

提交回复
热议问题