开发过程中有个页面需要用到表格,用了RelativeLayout布局实现,没有使用TableLayout。
整个表格需要使用一个圆角样式背景:
用水平直线分隔行(horizontal_line.xml):
用竖直直线分隔列(vertical_line.xml):
最后做出来的实际效果(截图后发现直线颜色太暗,手机上看起来效果还行):
[img]http://dl2.iteye.com/upload/attachment/0090/5036/3e3d16d1-7812-31c7-bf64-f9d56668ee3b.png[/img]
整个表格需要使用一个圆角样式背景:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<solid android:color="@color/white" />
<corners android:radius="5dp" />
<stroke
android:width="1dp"
android:color="#e4e2e2" />
</shape>
</item>
</layer-list>
用水平直线分隔行(horizontal_line.xml):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#e4e2e2" />
<size android:height="1dp" />
</shape>
用竖直直线分隔列(vertical_line.xml):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#e4e2e2" />
<size android:width="1dp" />
</shape>
最后做出来的实际效果(截图后发现直线颜色太暗,手机上看起来效果还行):
[img]http://dl2.iteye.com/upload/attachment/0090/5036/3e3d16d1-7812-31c7-bf64-f9d56668ee3b.png[/img]
2116

被折叠的 条评论
为什么被折叠?



