[英]Text aligned left and right in a Button
我有一个看起来像的按钮
[1 44.33]
使文本同时向左和向右对齐。
是否可以通过一个元素TextView
引入嵌套TextView
来实现?
您可以将ellipsize
设置为middle
,将Button的singleLine
设置为true
。
<Button
android:id="@+id/desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="so that the text is aligned to left and right at the same time.Is it possible to achieve it with a single element, w/o introducing nested TextViews?"
android:textColor="#888686"
android:ellipsize="middle"
android:singleLine="true"
android:textSize="15dp" />
是的,您可以检查Button Tag中的ellipsize元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.