天天看點

relativelayout設定邊框_Android TableLayout 增加邊框,以及圓角的實作方式

Android TableLayout 增加邊框,以及圓角的實作方式

釋出時間:2018-06-11作者:laosun閱讀(3821)

relativelayout設定邊框_Android TableLayout 增加邊框,以及圓角的實作方式

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來進行設定即可。

relativelayout設定邊框_Android TableLayout 增加邊框,以及圓角的實作方式

2 +1

版權聲明

發表評論

請文明留言

發表

共 0 條評論