欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android實現(xiàn)給TableLayou繪制邊框的方法

 更新時間:2016年03月10日 11:12:23   作者:yhm2046  
這篇文章主要介紹了Android實現(xiàn)給TableLayou繪制邊框的方法,涉及Android TableLayou布局控制相關(guān)技巧,需要的朋友可以參考下

本文實例講述了Android實現(xiàn)給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" >
    <!-- 微博數(shù) -->
    <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>
      <!-- 關(guān)注人數(shù) -->
      <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="關(guān)注" />
      </LinearLayout>
      <!-- 好友數(shù) -->
      <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>

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

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

相關(guān)文章

最新評論