当前位置: 代码迷 >> Android >> 怎么在一行TableRow里面怎么设置三个选项
  详细解决方案

怎么在一行TableRow里面怎么设置三个选项

热度:79   发布时间:2016-05-01 10:12:30.0
如何在一行TableRow里面如何设置三个选项?
如何在一行TableRow里面如何设置三个选项?

<TableRow>
           <CheckBox android:id="@+id/cbswim"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/checkboxsportswim"
          android:layout_gravity="left"
          />
           <CheckBox android:id="@+id/csrun"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/checkboxsportrun"
          android:layout_gravity="center_vertical"
         
          />
           <CheckBox android:id="@+id/csfootball"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/checkboxsportfootball"
          android:layout_gravity="right"
          />
        </TableRow>

我一行设置了三个,但是运行的时候只显示前两个。
如图

另外我知道应该去看源码,但是源码中都是类,我不知道如果通过看这些类文件来进行xml文件的配置。
谁能教一下?

------解决方案--------------------
<TableLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:shrinkColumns="3" >

....
</TableLayout>