最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android布局之GridLayout網(wǎng)格布局

 更新時間:2015年12月31日 10:53:39   作者:會飛的一只狼  
網(wǎng)格布局標簽是GridLayout。這個布局是android4.0新增的布局。這個布局只有4.0之后的版本才能使用。本文給大家介紹Android布局之GridLayout網(wǎng)格布局相關知識,感興趣的朋友一起學習吧

網(wǎng)格布局標簽是GridLayout。這個布局是android4.0新增的布局。這個布局只有4.0之后的版本才能使用。

不過新增了一些東東

①跟LinearLayout(線性布局)一樣,他可以設置容器中組件的對齊方式

②容器中的組件可以跨多行也可以跨多列(相比TableLayout直接放組件,占一行相比較)

因為是android 4.0新增的,API Level 14,在這個版本以前的sdk

都需要導入項目,等下會詳細介紹

常用屬性:

排列對齊:

①設置組件的排列方式:   android:orientation=""     vertical(豎直,默認)或者horizontal(水平)

②設置組件的對齊方式:   android:layout_gravity=""   center,left,right,buttom啊,這些,如果想同時用兩種的話:eg: buttom|left

學習導圖

(一)簡介

  網(wǎng)格布局由GridLayout所代表,在android4.0之后新增加的布局管理器,因此需要android4.0之后的版本中使用,如果在更早的平臺使用該布局管理器,則需要導入相應的支持庫<android.support.v7.widget.GridLayout>

(二)案列----計算器

<?xml version="1.0" encoding="utf-8"?>
<GridLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:rowCount="6"
  android:columnCount="4"
  android:layout_gravity="fill">
  <TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="0"
    android:textSize="80sp"
    android:layout_marginRight="5dp"
    android:layout_marginLeft="5dp"
    android:layout_columnSpan="4"
    android:background="#eee"
    android:padding="3sp"
    android:editable="false"
    android:textColor="#000"
    />
 <Button
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:layout_columnSpan="4"
   android:text="清除"
   android:textColor="#000"
   android:textSize="24dp"
   android:layout_marginLeft="5dp"
   android:layout_marginRight="5dp"
   android:background="@android:color/background_light"
   />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="7"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="8"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="9"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="+"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="4"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="5"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="6"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="-"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="1"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="2"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="3"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="*"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="."
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="0"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="="
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
  <Button
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="/"
    android:textColor="#000"
    android:textSize="24dp"
    android:layout_marginLeft="10dp"
    android:background="@android:color/background_light"
    />
</GridLayout>

以上內容是小編給大家介紹的Android布局之GridLayout網(wǎng)格布局相關知識,希望大家喜歡。

相關文章

  • 詳解Android的四大應用程序組件

    詳解Android的四大應用程序組件

    這篇文章主要介紹了Android的應用程序組件的相關資料,幫助大家更好的理解和使用Android,感興趣的朋友可以了解下
    2021-01-01
  • Android下載gradle失敗的解決方法

    Android下載gradle失敗的解決方法

    這篇文章主要介紹了Android下載gradle失敗的解決方法,文章通過圖文結合的方式給大家介紹的非常詳細,對大家的學習或工作有一定的幫助,需要的朋友可以參考下
    2024-06-06
  • Android自定義View實現(xiàn)標簽流效果

    Android自定義View實現(xiàn)標簽流效果

    這篇文章主要為大家詳細介紹了Android自定義View實現(xiàn)標簽流效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-02-02
  • Android仿音樂播放器帶進度的播放暫停按鈕

    Android仿音樂播放器帶進度的播放暫停按鈕

    這篇文章主要為大家詳細介紹了Android仿音樂播放器帶進度的播放暫停按鈕,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-12-12
  • Android開發(fā)中滑動分頁功能實例詳解

    Android開發(fā)中滑動分頁功能實例詳解

    這篇文章主要介紹了Android開發(fā)中滑動分頁功能,結合實例形式詳細分析了Android滑動分頁功能的具體步驟與相關實現(xiàn)技巧,代碼中備有詳盡的注釋便于理解,需要的朋友可以參考下
    2017-10-10
  • Android實現(xiàn)微信朋友圈發(fā)本地視頻功能

    Android實現(xiàn)微信朋友圈發(fā)本地視頻功能

    這篇文章主要介紹了Android實現(xiàn)微信朋友圈發(fā)本地視頻功能的相關資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2016-11-11
  • Android組件化、插件化詳細講解

    Android組件化、插件化詳細講解

    這篇文章主要介紹了Android組件化、插件化詳細講解,這些單獨?次封裝的功能模塊apk,就稱作插件,文章圍繞主題展開詳細的內容介紹,需要的朋友可以參考一下
    2022-07-07
  • Android自定義View實現(xiàn)天氣預報折線圖

    Android自定義View實現(xiàn)天氣預報折線圖

    這篇文章主要為大家詳細介紹了Android自定義View實現(xiàn)天氣預報折線圖,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-09-09
  • Android實現(xiàn)離線緩存的方法

    Android實現(xiàn)離線緩存的方法

    離線緩存就是在網(wǎng)絡暢通的情況下將從服務器收到的數(shù)據(jù)保存到本地,當網(wǎng)絡斷開之后直接讀取本地文件中的數(shù)據(jù)。本文給大家介紹Android實現(xiàn)離線緩存的方法,需要的朋友參考下
    2016-03-03
  • Android 基于Socket的聊天應用實例(二)

    Android 基于Socket的聊天應用實例(二)

    本篇文章主要介紹了Android 基于Socket的聊天應用實例,具有一定的參考價值,有需要的可以了解一下。
    2016-12-12

最新評論

视频| 来安县| 沧源| 北海市| 炉霍县| 民勤县| 灵宝市| 德惠市| 赣榆县| 兴仁县| 思茅市| 新丰县| 嵩明县| 新建县| 山西省| 南投市| 尖扎县| 六盘水市| 色达县| 开化县| 明水县| 禄劝| 莒南县| 博乐市| 常德市| 文水县| 湘阴县| 金平| 长丰县| 灵武市| 兴和县| 孝感市| 靖远县| 苍梧县| 天峻县| 洪洞县| 象山县| 醴陵市| 冀州市| 嘉定区| 岱山县|