如何突出显示表格布局的边框... 我正在使用以形状作为背景的 roundshape.xml
圆形.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="5dip" />
<gradient
android:angle="270"
android:endColor="@color/WhiteSmoke"
android:startColor="@color/WhiteSmoke"
android:type="linear" />
</shape>
白烟=#F5F5F5
主.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="400dp"
android:layout_height="400dp"
android:background="@drawable/roundshape"
>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
</LinearLayout>
最佳答案
我认为这可能会帮助你..通过代码你会找出诀窍
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="400dp"
android:layout_height="400dp"
android:background="@drawable/roundshape" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#ff9" >
<TextView
android:layout_width="fill_parent"
android:layout_height="1px"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is amazing" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#ff9" >
<TextView
android:layout_width="fill_parent"
android:layout_height="1px"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is amazing" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#ff9" >
<TextView
android:layout_width="fill_parent"
android:layout_height="1px"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is amazing" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#ff9" >
<TextView
android:layout_width="fill_parent"
android:layout_height="1px"
android:text="" />
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is amazing" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="#ff9" >
<TextView
android:layout_width="fill_parent"
android:layout_height="1px"
android:text="" />
</TableRow>
</TableLayout>
</LinearLayout>
关于android:如何显示TableLayout的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11781723/