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"
精彩评论