`

android之网格布局GridLayout

 
阅读更多

TableLayout(网格布局)

需要注意的:

网格布局需要最低版本支持:
API 14 也就是最低andriod4.0

layout/activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<GridLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="5"
android:orientation="horizontal">
<TextView android:text="用户名"/>
<EditText android:hint="请输入1-10个字符"
android:layout_columnSpan="4"
android:layout_gravity="fill_horizontal"
/>
<TextView android:text="密 码"/>
<EditText android:hint="请输入1-10个字符"
android:layout_columnSpan="4"
android:layout_gravity="fill_horizontal"
/>
</GridLayout>
<GridLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="5"
android:orientation="horizontal">
<Button android:text="不"
android:visibility="invisible"/>
<Button android:text="登陆"
android:drawableLeft="@drawable/login32x32"
android:background="@drawable/btn_bg"
android:textColor="#FFF"/>

<Button android:text="不"
android:visibility="invisible"
/>
<Button android:text="退出"
android:drawableLeft="@drawable/exit32x32"
android:background="@drawable/btn_bg"
android:textColor="#FFF"/>
<Button android:text="不"
android:visibility="invisible"/>
</GridLayout>


</LinearLayout>

效果:


分享到:
评论

相关推荐

    Android移动应用开发网格布局GridLayout的特点.pdf

    Android移动应用开发网格布局GridLayout的特点.pdf 学习资料 复习资料 教学资源

    Android移动应用开发网格布局GridLayout的常用属性.pdf

    Android移动应用开发网格布局GridLayout的常用属性.pdf 学习资料 复习资料 教学资源

    Android布局之GridLayout网格布局

    网格布局标签是GridLayout。这个布局是android4.0新增的布局。这个布局只有4.0之后的版本才能使用。本文给大家介绍Android布局之GridLayout网格布局相关知识,感兴趣的朋友一起学习吧

    Android使用GridLayout布局完成简易计算器界面设计的任务要求.pdf

    Android使用GridLayout布局完成简易计算器界面设计的任务要求.pdf 学习资料 复习资料 教学资源

    android布局控件总结

    LinearLayout 线性布局 控制组件 横向 或者 纵向 排列 ...GridLayout 网格布局 设置行列来装填控件 AbsoluteLayout 绝对布局 组件位置通过x, y坐标来控制, 布局容器不再管理组件位置, 大小, 这些都可以自定义;

    Android开发之计算器GridLayout布局实现方法示例

    本文实例讲述了Android开发之计算器GridLayout布局实现方法。分享给大家供大家参考,具体如下: 运行效果: Demo 下载地址:https://github.com/LonglyWolf/Calculator 或者点击此处本站下载。 按钮布局实现: 一个...

    Android中使用GridLayout网格布局来制作简单的计算器App

    主要介绍了Android中使用GridLayout网格布局来制作简单的计算器App的实例,GridLayout比表格布局TabelLayout更容易用来制作计算器这样的多按钮排列的界面,需要的朋友可以参考下

    DashboardLayout-网格布局控件,可以让你不需要考虑GridLayout,adapter.zip

    网格布局控件,可以让你不需要考虑GridLayout,adapter等,直接往布局里添加子控件即可。项目地址:https://github.com/rafi-kamal/Android-Dashboard-Layout-Library 效果图:如何使用直接添加子控件即可   ...

    Android基础入门教程——2.2.5 GridLayout(网格布局)-附件资源

    Android基础入门教程——2.2.5 GridLayout(网格布局)-附件资源

    Android Recyclerview实现水平分页GridView效果示例

    昨天UI妹子给了给需求,展示水平分页效果,而且第二页要默认显示一部分,提示用户水平可以滑动,先上效果图: 很明显横向滑动的分页,第一反应就是使用ViewPager,毕竟只要通过自定义ViewPager,实现这个效果还是很...

    5.4网格布局.pptx

    这是一个android开发的网格布局介绍,含代码和实例,基于android studio平台

    Android 界面布局

    Android提供了6种基本布局类:帧布局(FrameLayout)、线性布局(LinearLayout)、绝对布局(AbsoluteLayout)、相对布局(RelativeLayout)、表格布局(TableLayout)和网格布局(GridLayout)。另外,Android还推出一种新的...

    Android五大UI布局的特有属性

    1.LinearLayout线性布局2.RelativeLayout相对布局3.FrameLayout帧布局,空白布局4.GridLayout网格布局5.AbsoluteLayout绝对布局1、排列方向:vertical竖向,horizontal横向如:android:orientation="vertical"2、设置...

    一种常用的网格布局

    这是一种常用的网格布局案例,源码Android-Dashboard-Layout-Library,Dashboard Layout可以让你不需要考虑GridLayout,adapter等乱七八糟的东西就实现自己的dashboard(一种网格布局),兼容2.3 使用说明: 直接将...

    安卓开发—02 Android布局

    GridLayout(网格布局) RelativeLayout(相对布局) 用的较少 AbsoluteLayout(绝对布局) TableLayout(表格布局) 基本不用 1. 帧布局FrameLayout 帧布局是Android布局中最简单的一种,使用FrameLayout标签。 帧...

    Android自主学习项目报告(一).doc

    线性布局---LinearLayout 表格布局---TableLayout 相对布局---RelativeLayout 帧布局---FrameLayout 网格布局---GridLayout 绝对布局---AbsoluteLayout (5)Activity的两种启动方式、四种状态、四种模式 直接启动 ...

    GridLayout.zip

    利用网格布局设置了一个华为主题中的字体布局页面,非常美观,效果明显,涵盖了之前学习的知识

Global site tag (gtag.js) - Google Analytics