text align with different character count
I am really开发者_如何学运维 really sorry about my poor English
Here is what I made.
with
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/txtTImeRemain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginRight="50dip"
android:textColor="#ff000000"
android:gravity="center_vertical|left"
/>
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginRight="5dip"
android:textColor="#ff000000"
android:gravity="center_vertical|right"
/>
</LinearLayout>
My question is.
I want to align the left most words to being center of their row. regardless how many character they have.
Use a TableLayout
, then you can set the layout_gravity for the different parts of the table row.
精彩评论