android 学习 之 布局(下)LinearLayout,RelativeLayout,TableLayout,FrameLayout
<LinearLayout 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="#FFFFCC"
android:orientation="vertical"
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="com.rhythmk.app.MainActivity$PlaceholderFragment" > <!--
wap_content :包裹实际文本宽度, match_parent: 铺满父类容器, fill_parent:铺满父类容器 --> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮1" /> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮2" /> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮3" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#CCCC66"
android:orientation="horizontal" > <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮01" /> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮02" /> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮03" />
</LinearLayout> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#99CC66"
android:orientation="horizontal" > <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮11" /> <Button
android:id="@+id/btn12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="150sp"
android:layout_marginTop="50sp"
android:text="按钮12" /> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="60sp"
android:layout_marginTop="50sp"
android:layout_toRightOf="@+id/btn12"
android:text="按钮13" />
</RelativeLayout> <TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#9933CC"
android:shrinkColumns="1"
android:stretchColumns="0,1,2" > <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="独立行" /> <TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" > <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮21" /> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮22" /> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮22" />
</TableRow> <TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" > <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="按钮31" /> <Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:text="我可以自动延生" />
</TableRow>
</TableLayout> <FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0033CC"
android:padding="20px" > <Button
android:layout_width="250px"
android:layout_height="150px"
android:background="#330033"
android:text="FrameLayout001" /> <Button
android:layout_width="250px"
android:layout_height="150px"
android:layout_marginLeft="100sp"
android:layout_marginTop="80sp"
android:background="#990066"
android:text="FrameLayout002" />
</FrameLayout> </LinearLayout>
android 学习 之 布局(下)LinearLayout,RelativeLayout,TableLayout,FrameLayout的更多相关文章
- Android学习5—布局简介
Android界面的布局主要有四种,分别为RelativeLayout.LinearLayout.TableLayout.FrameLayout,接下来分别介绍这些布局如何使用(为了简单起见,接下来的 ...
- android 学习Layout布局的使用
android 常用布局 LinearLayout(线性布局) 线性的 垂直的 水平的RelativeLaytout(相对布局) 最灵活的TableLayout(表格布局) 使用GridView代替A ...
- android 学习 之 布局(上)
学习安卓布局前,先了解三个属性值: 1.fill_parent: 设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间 2.match_parent: And ...
- Android四种基本布局(LinearLayout \ RelativeLayout \ FrameLayout \ TableLayout)
------------------------------------------LinearLayout---------------------------------------------- ...
- Android学习之——ListView下拉刷新
背景知识 ListView使用非常广泛,对于使用ListView的应用来说,下拉刷新是必不可少要实现的功能. 我们常用的微博.网易新闻,搜狐新闻都使用了这一功能,如下图所示. 微博 搜狐新闻 ...
- Android学习----五大布局
1.LinearLayout 线性布局 android:orientation="horizontal" 制定线性布局的排列方式 水平 horizontal 垂直 vertical ...
- Android学习笔记—Windows下NDK开发简单示例
该示例假设Android开发环境已经搭建完成,NDK也配置成功: 1.在Eclipse上新建Android工程,名称为ndkdemo.修改res\layout\activity_main.xml &l ...
- 【Android学习】Windows下Android环境搭建
一. JDK下载配置 直接百度,很简单. 二.android JDK下载配置 1.进入下载官网(需要FQ):https://developer.android.com/studio/index.ht ...
- Android学习笔记02-Mac下编译java代码
在Mac OS上配置JDK 1.7. 一 下载 Mac版本的JDK1.7 从以下下载地址,下载Mac版本的JDk1.7 安装文件 jdk-7u79-macosx-x64.dmg. http://www ...
随机推荐
- WPF资源
在WPF中.有着两种资源, 一种是组件资源:又被称为程序集资源,以二进制存在编译后的程序集中,通常用于存放图片或其他音频文件. 第二种是对象资源:通常放于xaml中.比如WPF的样式和数据绑定特性. ...
- appium+pytest+allure+jenkins 如何实现多台手机连接
使用appium可以实现app自动化测试,我们之前是连接一台手机去运行,如何同时连接多台手机呢?很多人可能想到的是多线程(threading).今天分享一种比多线程更简单的方法,虽然不是多台手机同时运 ...
- poj3666&&bzoj1592
题解: 和bzoj1367差不多 然后a[i]-i不用加 然后我再另一个地方加了这句话 然后poj ac,bzoj wa poj数据水啊 代码: #include<cstdio> #inc ...
- Java 复制一个文件到另外一个目录下
因为项目部署在jboss上面,在上传一些图片的时候,把他上传到当前项目的下,比如:(这里是以Windows服务器为例的,当然linux也是一样的) D:\jboss-eap-6.4\domain\se ...
- 20181009-2 选题 Scrum立会报告+燃尽图(01)
Scrum立会报告+燃尽图(01)选题 此作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2190 一.小组介绍 组长:刘莹莹 ...
- (转)List<T>的各种排序方法
近日,在工作的时候遇到要对一个大的List<T>集合进行排序,于是就了解下各种List<T>的排序方法. 首先,排序自然就会想到用Sort方法,看看List<T>的 ...
- 20155322 2016-2017-2 《Java程序设计》第6周学习总结
20155322 2016-2017-2 <Java程序设计>第6周学习总结 教材学习内容总结 第六周学习的主要内容是课本的第十第十一章: 第十章介绍的是输入.输出,Java中的流分为两种 ...
- Oracle序列和伪表
创建序列 create sequence sq_teacher_tnostart with 10 从哪一个数字开始increment by 1 每次增长的数字maxvalue 999999999999 ...
- redis的maxmemory与maxmemory-policy关系
如果redis配置了maxmemory和maxmemory-policy策略,则当redis内存数据达到maxmemory时,会根据maxmemory-policy配置来淘汰内存数据,以避免OOM.r ...
- 02 - Unit05:加载笔记列表
加载笔记列表 发送Ajax请求 绑定发送事件 获取参数: bookId 发送请求: /note/list.do 事件绑定 $(function(){ Ajax请求发送-->服务器处理--> ...