简体   繁体   English

TextView 中的 paddingBottom 和 paddingEnd 有什么区别?

[英]What is the difference between paddingBottom and paddingEnd in a TextView?

I understand the difference between padding and margin, but I don't understand the difference between those two pairs of attributes: bottom and end and on the other hand start and top.我了解填充和边距之间的区别,但我不了解这两对属性之间的区别:底部和结束以及另一方面开始和顶部。 Documentation文档

It's pretty clear: your TextView has a bound and padding is distance from the bound to the context (where text is rendered)很清楚:你的 TextView 有一个边界,填充是从边界到上下文的距离(文本被渲染的地方) 在此处输入图像描述

In the picture, padding is green area.在图片中,填充是绿色区域。

  • paddingTop is upper distance paddingTop 是上距离
  • paddingBottom is down distance paddingBottom 向下距离
  • paddingStart is right distance if rtl is enabled, otherwise it's left distance如果启用了 rtl,则 paddingStart 为右距离,否则为左距离
  • paddingEnd is left distance if rtl is enabled, otherwise it's right distance如果启用 rtl,则 paddingEnd 为左侧距离,否则为右侧距离

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM