国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android實現給TableLayou繪制邊框的方法

2020-01-02 07:00:43
字體:
來源:轉載
供稿:網友

本文實例講述了Android實現給TableLayou繪制邊框的方法。分享給大家供大家參考,具體如下:

效果如下:

思路:使用share作為背景顯示邊框

步驟

1.在res/drawable文件夾下建立table_frame_gray.xml文件:

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"  android:shape="rectangle" >  <solid android:color="#ffffff" />  <stroke    android:width="0.01dp"    android:color="#848484" /></shape>

2.在布局文件里引用table_frame_gray.xml文件作為背景:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  xmlns:tools="http://schemas.android.com/tools"  android:layout_width="match_parent"  android:layout_height="match_parent"  android:background="#FFFF00"  android:paddingBottom="@dimen/activity_vertical_margin"  android:paddingLeft="@dimen/activity_horizontal_margin"  android:paddingRight="@dimen/activity_horizontal_margin"  android:paddingTop="@dimen/activity_vertical_margin"  tools:context=".MainActivity" >  <TableLayout    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:background="#FF4000"    android:stretchColumns="*"    android:text="@string/hello_world" >    <!-- 微博數 -->    <TableRow>      <LinearLayout        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:background="@drawable/table_frame_gray"        android:orientation="vertical" >        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:padding="5dp"          android:text="232" />        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:padding="5dp"          android:text="微博" />      </LinearLayout>      <!-- 關注人數 -->      <LinearLayout        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:background="@drawable/table_frame_gray"        android:orientation="vertical" >        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:padding="5dp"          android:text="38" />        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:padding="5dp"          android:text="關注" />      </LinearLayout>      <!-- 好友數 -->      <LinearLayout        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:background="@drawable/table_frame_gray"        android:orientation="vertical" >        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:padding="5dp"          android:text="9" />        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:padding="5dp"          android:text="粉絲" />      </LinearLayout>    </TableRow>  </TableLayout></RelativeLayout>

更多關于Android相關內容感興趣的讀者可查看本站專題:《Android調試技巧與常見問題解決方法匯總》、《Android開發入門與進階教程》、《Android多媒體操作技巧匯總(音頻,視頻,錄音等)》、《Android基本組件用法總結》、《Android視圖View技巧總結》、《Android布局layout技巧總結》及《Android控件用法總結

希望本文所述對大家Android程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 合江县| 伊川县| 乐山市| 禄劝| 西充县| 留坝县| 凤城市| 页游| 城固县| 虎林市| 兴城市| 青神县| 横山县| 沈阳市| 蓬莱市| 清新县| 浏阳市| 安丘市| 怀柔区| 昭通市| 贵州省| 犍为县| 库尔勒市| 桑日县| 泰安市| 大同市| 信阳市| 通渭县| 麦盖提县| 南部县| 渭南市| 康乐县| 巴中市| 招远市| 峨山| 永昌县| 湄潭县| 西贡区| 克东县| 来凤县| 尉犁县|