Reputation: 20699
I have a button which shall look like
[1 44.33]
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 TextView
s?
Upvotes: 0
Views: 173
Reputation: 1213
Yes, you can check the ellipsize element in Button Tag.
Upvotes: 1
Reputation: 10959
You can set ellipsize
to middle
and set singleLine
to true
for Button.
<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" />
Upvotes: 1