Android TableLayout 增加边框,以及圆角的实现方式
发布时间:2018-06-11作者:laosun阅读(3821)
android 使用tablelayout实现圆角边框布局:
首先来看activity_main.xml的布局代码<?xml version="1.0" encoding="utf-8"?>
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ebe7e4"
android:collapseColumns="3">
android:id="@+id/tablerow"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="20dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/table_shape">
android:layout_width="fill_parent"
android:layout_height="wrap_content">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="第一行" />
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_margin="2dp"
android:background="#c5c5c5" />
android:layout_width="fill_parent"
android:layout_height="wrap_content">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="第二行" />
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_margin="2dp"
android:background="#c5c5c5" />
android:layout_width="fill_parent"
android:layout_height="wrap_content">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="第三行" />
增加一个table_shape.xml,来设置边框圆角宽度等设置
android:width="1.0dip"
android:color="#FF0000" />
table 表格设置边框,以及四个角进行圆角设置,都在table_shape.xml内进行。table行之间的横线使用view来进行设置即可。
2 +1
版权声明
发表评论
请文明留言
发表
共 0 条评论