首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

水平线跟竖直线的布局样式

2013-10-29 
水平线和竖直线的布局样式开发过程中有个页面需要用到表格,用了RelativeLayout布局实现,没有使用TableLayo

水平线和竖直线的布局样式
开发过程中有个页面需要用到表格,用了RelativeLayout布局实现,没有使用TableLayout。

整个表格需要使用一个圆角样式背景:

<?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>


最后做出来的实际效果(截图后发现直线颜色太暗,手机上看起来效果还行):


热点排行