开发者

text align with different character count

开发者 https://www.devze.com 2023-04-01 03:10 出处:网络
I am really开发者_如何学运维 really sorry about my poor English Here is what I made. with <LinearLayout

I am really开发者_如何学运维 really sorry about my poor English

Here is what I made.

text align with different character count

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号