负填充的影响 [英] Effects of Negative padding
问题描述
我刚刚开始学习android,我对负填充有疑问.负填充如何精确地影响视图?
I'm just starting to learn android and i had a question regarding negative padding. How exactly does negative padding affect the view ?
此外,假设我引入了bottomPadding
的"-5dp".这是否会将填充的边界扩展5dp?
Also, say I introduce a bottomPadding
of "-5dp". Does this extend of the boundary of the padding by 5dp ?
感谢所有帮助! :)
推荐答案
在LinearLayout
和RelativeLayout
中设置负填充后,您会注意到内容向相反方向移动-例如,如果将paddingLeft
设置为- 5dp,它将向左移动5dp,而将其设置为5dp将导致内容移动到右侧位置.
In LinearLayout
and RelativeLayout
after setting negative padding you will notice movement of the content into opposite direction - for example if you set paddingLeft
to -5dp, it will be moved to the left side by 5dp, whereas setting it to 5dp would cause content to be moved into right position.
这篇关于负填充的影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!