[英]Can TextViews be clipped both horizontally and vertically in XML?
I have a TextView that I want to clip both horizontally and vertically. 我有一个TextView,我想同时水平和垂直剪切。
<TextView android:layout_width="10dip" android:text=""
android:layout_gravity="clip_vertical"
android:layout_gravity="clip_horizontal">
</TextView>
but of course that's invalid XML. 但这当然是无效的XML。
Is there any way of combining these within the XML file? 有什么方法可以在XML文件中将它们组合起来? I can see from the documentation that the switches are bitmap fields.
从文档中可以看到,这些开关是位图字段。 I guess what I want something like:
我想我想要什么:
view.layout_gravity = Gravity.CLIP_HORIZONTAL | Gravity.CLIP_VERTICAL
but without having to dismember the Java. 但不必肢解Java。
尝试
android:layout_gravity="clip_horizontal|clip_vertical"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.