0

テキストの配置を変更しようとしていました。これは私が持っているものです:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">

    <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
        <TableRow>
         <TextView
            android:id="@+id/ctime"
            android:layout_gravity="right"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="50"
            android:text="time" />
        </TableRow>
        <TableRow>

           <TextView
               android:id="@+id/cstatus"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:layout_gravity="right"
               android:layout_weight="100"
               android:text="status" />

</TableRow>
</TableLayout>
 </LinearLayout>

を設定した後でも、すべてが出力で左揃えになりますandroid:layout_gravity="right"。レイアウト全体を投稿できないため、これはレイアウトの一部です。

4

1 に答える 1

3

これを使う

android:gravity="right"
于 2012-06-05T20:17:06.590 に答える