0

ダイアログボックスのコンテンツビューとして設定された次のレイアウトを XML で設定しています私は彼らにそうします、彼らは左側にとどまります。これは、ダイアログ内にあることと関係がありますか? どうすれば修正できますか?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:padding="10dip"
   android:background="#FF9E00"
   android:orientation="vertical">

   <TableLayout
       android:layout_width="fill_parent"
       android:layout_height="wrap_content">

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#A0DB84">
   <TextView android:id="@+id/creatediagtxt"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="TEST"/>
   </TableRow>

   <TableRow
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:background="#004884"> 

 <Button android:id="@+id/Button01" 
 android:layout_width="wrap_content" android:layout_height="wrap_content" 
 android:text="Cancel" android:layout_gravity="center"/>

 <Button android:id="@+id/Button02" 
 android:layout_width="wrap_content" android:layout_height="wrap_content"
 android:text="Done" />

 </TableRow>

 </TableLayout>

4

1 に答える 1

2

で遊ぶことができlayout_weightます。例えば:

<TableRow
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:background="#004884"
   android:layout_weight="1"> 

 <Button android:id="@+id/Button01" 
  android:layout_width="wrap_content" android:layout_height="wrap_content" 
   android:text="Cancel" android:layout_weight="0.5"/>

 <Button android:id="@+id/Button02" 
  android:layout_width="wrap_content" android:layout_height="wrap_content"
  android:text="Done" android:layout_weight="0.5" />

 </TableRow>
于 2012-03-17T14:24:43.417 に答える