我如何突出显示表格布局的边框...
在使用以形状为背景的圆形 shape.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
main.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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)