[英]Android Textview - letters and numbers alignment
i want to display long String in TextView, and part of the string (letters), is in the right side, and numbers appears in the left one, how can i display the numbers in right?? 我想在TextView中显示长字符串,字符串的一部分(字母)在右侧,数字显示在左侧,如何在右侧显示数字?
thanks alot. 非常感谢。
Try this: 尝试这个:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<TextView
android:id="@+id/numbers"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left" />
<TextView
android:id="@+id/letters"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right" />
</LinearLayout>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.