欧美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ā)入門與進階教程》、《Android多媒體操作技巧匯總(音頻,視頻,錄音等)》、《Android基本組件用法總結(jié)》、《Android視圖View技巧總結(jié)》、《Android布局layout技巧總結(jié)》及《Android控件用法總結(jié)

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

相關(guān)文章

  • Flutter進階之實現(xiàn)動畫效果(五)

    Flutter進階之實現(xiàn)動畫效果(五)

    這篇文章主要為大家詳細介紹了Flutter進階之實現(xiàn)動畫效果的第五篇,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-08-08
  • Android自定義ViewPager實現(xiàn)縱向滑動翻頁效果

    Android自定義ViewPager實現(xiàn)縱向滑動翻頁效果

    這篇文章主要為大家詳細介紹了Android自定義ViewPager實現(xiàn)縱向滑動翻頁效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • Android編程實現(xiàn)在Bitmap上涂鴉效果

    Android編程實現(xiàn)在Bitmap上涂鴉效果

    這篇文章主要介紹了Android編程實現(xiàn)在Bitmap上涂鴉效果的方法,涉及Android界面布局,事件響應及Bitmap操作的相關(guān)技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    2015-12-12
  • Android編程動態(tài)加載布局實例詳解【附demo源碼】

    Android編程動態(tài)加載布局實例詳解【附demo源碼】

    這篇文章主要介紹了Android編程動態(tài)加載布局,結(jié)合實例形式分析了Android動態(tài)加載布局的原理、操作步驟與相關(guān)實現(xiàn)技巧,需要的朋友可以參考下
    2016-10-10
  • Android編程之View簡單學習示例

    Android編程之View簡單學習示例

    這篇文章主要介紹了Android編程之View簡單學習示例,以一個實例形式較為詳細的分析了View的功能、定義及使用技巧,需要的朋友可以參考下
    2015-10-10
  • Android實現(xiàn)加載等待展示

    Android實現(xiàn)加載等待展示

    這篇文章主要為大家詳細介紹了Android實現(xiàn)加載等待展示,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-08-08
  • Android本地搜索業(yè)務優(yōu)化方案

    Android本地搜索業(yè)務優(yōu)化方案

    這篇文章主要為大家介紹了Android本地搜索業(yè)務優(yōu)化方案詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-05-05
  • Android studio編寫簡單的手電筒APP

    Android studio編寫簡單的手電筒APP

    一個簡單的APP控制的手電筒代碼,android studio編寫一個手電筒app,調(diào)用手機的閃光等實現(xiàn)手電筒的功能,感興趣的小伙伴們可以參考一下
    2016-08-08
  • RxJava2.x實現(xiàn)定時器的實例代碼

    RxJava2.x實現(xiàn)定時器的實例代碼

    本篇文章主要介紹了RxJava2.x實現(xiàn)定時器,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-06-06
  • Android手機注冊登錄時獲取驗證碼之后倒計時功能(知識點總結(jié))

    Android手機注冊登錄時獲取驗證碼之后倒計時功能(知識點總結(jié))

    這篇文章主要介紹了Android手機注冊登錄時獲取驗證碼之后倒計時(知識點總結(jié))功能,代碼簡單易懂,非常不錯,具有參考借鑒價值,需要的的朋友參考下吧
    2017-01-01

最新評論