Android linearlayout常用布局
用linearlayout完成这样的布局效果,这样的布局还是比较常用的,具体的xml代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1" >
<Button
android:id="@+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:gravity="right">
<Button
android:id="@+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1">
<Button
android:id="@+id/button3"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button android:id="@+id/button4" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /><LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:gravity="right" >
<Button
android:id="@+id/button5"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Android linearlayout常用布局的更多相关文章
- Android 之常用布局
LinearLayout 线性布局. android:orientation="horizontal" 制定线性布局的排列方式 水平 horizontal 垂直 vertical ...
- Android LinearLayout线性布局详解
为了更好地管理Android应用的用户界面里的各组件,Android提供了布局管理器.通过使用布局管理器,Android应用图形用户界面具有良好的平台无关性.推荐使用布局管理器来管理组件的分布.大小, ...
- Android中常用布局单位
Android在UI布局时经常用到一些单位,对单位混用直接会影响UI的显示,要想正确的在布局中使用每种单位就必须先真正的熟悉它. UI显示效果的影响因素:屏幕尺寸.屏幕密度.分辨率:而android手 ...
- Android LinearLayout线性布局
LinearLayout是线性布局控件:要么横向排布,要么竖向排布 决定性属性:必须有的! android:orientation:vertical (垂直方向) .horizontal(水平方向) ...
- Android LinearLayout整个布局设置不可点击
1,activity的xml布局(布局中有个Button按钮,点击按钮弹出一个popupwindow ) <?xml version="1.0" encoding=" ...
- Android中常用布局
1.线性布局 LinearLayout orientation:方向:vertical,垂直:horizontal,水平 gravity:对齐方式,子控件相对于当前 ...
- Android零基础入门第25节:最简单最常用的LinearLayout线性布局
原文:Android零基础入门第25节:最简单最常用的LinearLayout线性布局 良好的布局设计对于UI界面至关重要,在前面也简单介绍过,目前Android中的布局主要有6种,创建的布局文件默认 ...
- Android常用布局
FrameLayout(框架布局):从屏幕的左上角开始显示对象,一个覆盖一个,主要用于选项卡视图和图像切换器.# 所有的组件都放在屏幕的左上角,并且以层叠进行显示. LinearLayout(线性布局 ...
- Android中常用的5大布局详述
Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦.组件按照布局的要求依次排列,就组成了用户所看见的界面. 所有的布局方式都可以归类为ViewGroup的 ...
随机推荐
- YTU 3013: 皇后问题(递归)
3013: 皇后问题(递归) 时间限制: 1 Sec 内存限制: 128 MB 提交: 2 解决: 2 题目描述 编写一个函数,求解皇后问题:在n*n的方格棋盘上,放置n个皇后,要求每个皇后不同行 ...
- c3p0数据库连接池(作用不重复)
/* * c3p0数据库连接池: * 只被初始化一次 * connection对象进行close时,不是正的关闭,而是将该数据连接归还给数据库连接池 * * */ 四个架包 mysql-connect ...
- (jdbc)取得数据库自动生成的主键方法
一些类,在前面的博客中有,就不重复了 public class Test2 { TestDAO t=new TestDAO(); /*前提是数据表的主键是自动增加的, *取得数据库自动生成的主键 * ...
- I Think I Need a Houseboat 分类: POJ 2015-06-11 17:52 12人阅读 评论(0) 收藏
I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 92090 Acce ...
- Uva 1220,Hali-Bula 的晚会
题目链接:https://uva.onlinejudge.org/external/12/1220.pdf 题意: 公司n个人,形成一个数状结构,选出最大独立集,并且看是否是唯一解. 分析: d(i) ...
- php操作redis常用方法源代码
1,connect 描述:实例连接到一个Redis.参数:host: string,port: int返回值:BOOL 成功返回:TRUE;失败返回:FALSE 示例: <?php $redis ...
- SSH配置私钥登陆服务器
前言 本文基于实际Linux管理工作,实例讲解工作中使用ssh证书登录的实际流程,讲解ssh证书登录的配置原理,基于配置原理,解决实际工作中,windows下使用SecureCRT证书登录的各种问题, ...
- ios事件传递
http://blog.csdn.net/iefreer/article/details/4754482 本章描述了iPhone操作系统里的事件类型,并解释了如何处理它们.还讨论了怎么在一个应用程序里 ...
- jquery 获得星期几-根据当前日期判断是星期几
jquery 获得星期几 <script type="text/javascript"> var date = "07/17/2014"; / ...
- C语言实现单向链表及其各种排序(含快排,选择,插入,冒泡)
#include<stdio.h> #include<malloc.h> #define LEN sizeof(struct Student) struct Student / ...