线性布局综合案例
来源:互联网 发布:电脑怎么下载淘宝 编辑:程序博客网 时间:2024/05/17 00:06
现在我们来分析上图的布局:
首先根标签是线性布局,布局方式是垂直的,在这个布局中又有两个线性布局,上面的是水平布局,下面的是垂直布局,并且每个布局中有两个TextView,且两个TextView居中显示,并且之间存在边距
XML<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center" android:orientation="horizontal" android:background="#ff0000"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00ffff" android:text="first" android:layout_marginRight="10dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00ffff" android:text="second" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:orientation="vertical" android:layout_weight="1" android:gravity="center" android:background="#ff00ff"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#0000ff" android:text="first" android:layout_marginBottom="10dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#0000ff" android:text="second" /> </LinearLayout></LinearLayout>
阅读全文
0 0
- 线性布局综合案例
- 线性布局案例(2)
- 安卓线性布局案例之计算器
- 7.css综合案例---仿sohu网站首页布局
- UI基础控件综合案例之XML布局编写
- 综合/案例
- 综合案例
- 综合案例
- android开发4:布局管理器1(线性布局,相对布局RelativeLayout-案例)
- 线性布局
- 线性布局
- 线性布局
- 线性布局
- 线性布局
- 线性布局
- 线性布局
- 线性布局
- jbpm4综合案例视频教程
- [LeetCode]565. Array Nesting
- JavaScript 02
- 排序算法之快速排序
- JVM源码阅读-Dalvik类的加载
- OpenCV直方图(1)
- 线性布局综合案例
- bash的测试和比较
- 单例模式
- 【机器学习】支持向量机(SVM)浅讲
- 数据库设计的规范
- c++ 一个元素是string的vector容器
- IWBootStrapFrameWork在C++Builder XE10.1下的安装与试用
- java tomcat eclipse 环境变量配置
- 总结坑自己的一天——关于一个叫“安全狗”的软件