Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 文本与不同字符数对齐_Android_Android Layout - Fatal编程技术网

Android 文本与不同字符数对齐

Android 文本与不同字符数对齐,android,android-layout,Android,Android Layout,我真的很抱歉我的英语很差 这是我做的 与 我的问题是 我想将最左边的单词对齐,使其成为行的中心。无论它们有多少个字符。使用表格布局,然后您可以为表格行的不同部分设置布局重力。我最初的问题不是“行”,而是“列”,但我用表格布局和布局重力解决了它。非常感谢。 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" an

我真的很抱歉我的英语很差

这是我做的


我的问题是


我想将最左边的单词对齐,使其成为行的中心。无论它们有多少个字符。

使用
表格布局
,然后您可以为表格行的不同部分设置布局重力。

我最初的问题不是“行”,而是“列”,但我用表格布局和布局重力解决了它。非常感谢。
  <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>