In my Android project, I've a TextView which displays a long text. I want to give some space between lines like we do in CSS with line-height property. How can we do this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you want padding between text try
LineSpacingExtra="10dp"
This supplemental answer shows the effect of changing the line spacing.
You can set the multiplier and/or extra spacing with
Or you can get the values with
where the formula is
The default multiplier is
1
and the default extra spacing is0
.You can use
TextView.setLineSpacing(n,m)
function.Adding
android:lineSpacingMultiplier="0.8"
can make the line spacing to 80%.you can look into
android:lineSpacingExtra
and apply it to your XMLAdditional Info is on this page
or the related method
public void setLineSpacing (float add, float mult)
Additional Info here
You can use
lineSpacingExtra
andlineSpacingMultiplier
in your XML file.