0

ListView各行に2つの単語がある場所があります。2 つの単語を少し隙間を空けて中央に配置したいと思います。

(いくつかのランダムな単語...)に似ています:

 Please    Help
     me    !!
   This    should
    not    be
     so    hard            

の各行ListViewは 2 つTextViewの で構成されています。

4

1 に答える 1

2
<LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.4"
        android:gravity="right" />

    <View
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0.2"
        />

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="0.4"
        android:gravity="left" />

</LinearLayout>
于 2013-03-08T20:01:58.687 に答える