作者:动感奥13 | 来源:互联网 | 2023-05-18 19:25
IdohaveaproblemwithTextView.Idontwanttohaveanymarginpaddingaboveit.我确实遇到TextView问
I do have a problem with TextView
. I don't want to have any margin/padding above it.
我确实遇到TextView问题。我不希望它上面有任何边距/填充。
My TextView
looks like this and despite the textSize
and height
are set to the same value, there is a space above font. It bothers me because I want to put another view relatively to the top of the font. Is this spacing included into font itself?
我的TextView看起来像这样,尽管textSize和height设置为相同的值,但字体上方还有一个空格。这让我感到困扰,因为我想将另一个视图放在相对于字体顶部的位置。这个间距是否包含在字体本身中?
![TextView in RelativeLayout](https://www.#.com/imgs/3/0/9/2/11/41ecc85a3118636a003b3444d9e4e7e3.jpe)
And another question: If I found out that margin 20dp from top and 7dp from bottom works perfectly on my device, can I rely that it will behave in a similar way on other screens? (these margins are for buttons)
还有一个问题:如果我发现距离顶部20dp和底部7dp的余量在我的设备上完美运行,我可以依赖它在其他屏幕上的行为方式相似吗? (这些边距适用于按钮)
4 个解决方案