开发者

Can TextViews be clipped both horizontally and vertically in XML?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜