开发者

Can TextViews be clipped both horizontally and vertically in XML?

开发者 https://www.devze.com 2023-03-14 03:16 出处:网络
I have a TextView that I want to clip both horizontally and vertically. <TextView android:layout_width=\"10dip\" android:text=\"\"

I have a TextView that I want to clip both horizontally and vertically.

<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.

Is there any way of combining these within the XML file? I can see from the documentation that the switches are bitma开发者_运维问答p fields. I guess what I want something like:

view.layout_gravity = Gravity.CLIP_HORIZONTAL | Gravity.CLIP_VERTICAL

but without having to dismember the Java.


try with

android:layout_gravity="clip_horizontal|clip_vertical"
0

精彩评论

暂无评论...
验证码 换一张
取 消