简体   繁体   English

TextView- setHeight和setTextSize之间的区别:Android

[英]TextView- difference between setHeight and setTextSize: Android

setHeight和setTextSize有什么区别?

I'm assuming you're talking about a TextView. 我假设您正在谈论TextView。 setHeight() sets the view's height, and setTextSize() sets how large the text will be within the view. setHeight()设置视图的高度, setTextSize()设置文本在视图中的大小。 Thus, a view can take up more space than just its text, which comes into play when using layouts such as RelativeLayout. 因此,一个视图可能会占用更多空间,而不仅仅是文本,这在使用诸如RelativeLayout之类的布局时会发挥作用。

setHeight是组件的高度,如果在组件中将seTextSize设置为15,则该组件中将仅允许15个字符。

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

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