如何在android中有部分

时间:2013-09-05 12:46:53

标签: android

我希望有一些部分,即至少是一种将2个逻辑部分分开的条状物。最重要的是我有edittext字段和底部我有textview。我之间需要一些分隔符。怎么做?请注意,edittext和textview都位于同一tablelayout的不同行中。

提前致谢!

1 个答案:

答案 0 :(得分:0)

使用所需的android:layout_widthandroid:layout_height添加视图,您可以相应地构建具有不同厚度的线条。 如果您想使用水平线分隔两个视图,那么请按照代码段帮助您:

水平线:

<EditText/>

<View
 android:layout_width="fill_parent"
 android:layout_height="1dp"
 android:background="@android:color/black" />

<TextView/>

垂直线:

<EditText/>

<View
 android:layout_width="1dp"
 android:layout_height="fill_parent"
 android:background="@android:color/black" />

<TextView/>

到目前为止你的表格有点关注:

 <TableLayout>
       <TableRow>
            <EditText/>
       </TableRow>
       <TableRow>
            <View/>
       </TableRow>
       <TableRow>
            <TextView/>
       </TableRow>
 </TableLayout>