<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的更多相关文章

  1. Android学习5—布局简介

    Android界面的布局主要有四种,分别为RelativeLayout.LinearLayout.TableLayout.FrameLayout,接下来分别介绍这些布局如何使用(为了简单起见,接下来的 ...

  2. android 学习Layout布局的使用

    android 常用布局 LinearLayout(线性布局) 线性的 垂直的 水平的RelativeLaytout(相对布局) 最灵活的TableLayout(表格布局) 使用GridView代替A ...

  3. android 学习 之 布局(上)

    学习安卓布局前,先了解三个属性值: 1.fill_parent: 设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间 2.match_parent: And ...

  4. Android四种基本布局(LinearLayout \ RelativeLayout \ FrameLayout \ TableLayout)

    ------------------------------------------LinearLayout---------------------------------------------- ...

  5. Android学习之——ListView下拉刷新

    背景知识 ListView使用非常广泛,对于使用ListView的应用来说,下拉刷新是必不可少要实现的功能. 我们常用的微博.网易新闻,搜狐新闻都使用了这一功能,如下图所示.     微博 搜狐新闻 ...

  6. Android学习----五大布局

    1.LinearLayout 线性布局 android:orientation="horizontal" 制定线性布局的排列方式 水平 horizontal 垂直 vertical ...

  7. Android学习笔记—Windows下NDK开发简单示例

    该示例假设Android开发环境已经搭建完成,NDK也配置成功: 1.在Eclipse上新建Android工程,名称为ndkdemo.修改res\layout\activity_main.xml &l ...

  8. 【Android学习】Windows下Android环境搭建

    一.  JDK下载配置 直接百度,很简单. 二.android JDK下载配置 1.进入下载官网(需要FQ):https://developer.android.com/studio/index.ht ...

  9. Android学习笔记02-Mac下编译java代码

    在Mac OS上配置JDK 1.7. 一 下载 Mac版本的JDK1.7 从以下下载地址,下载Mac版本的JDk1.7 安装文件 jdk-7u79-macosx-x64.dmg. http://www ...

随机推荐

  1. IOS-适配iOS10以及Xcode8

    现在在苹果的官网上,我们已经可以下载到Xcode8的GM版本了,加上9.14日凌晨,苹果就要正式推出iOS10系统的推送了,在此之际,iOS10的适配已经迫在眉睫啦,不知道Xcode8 beat版本, ...

  2. 5G RRC——为NAS层提供连接管理,消息传递等服务; 对接入网的底层协议实体提供参数配置的功能; 负责UE移动性管理相关的测量、控制等功能

    from:http://www.cnblogs.com/kkdd-2013/p/3868676.html 1 RRC协议功能 为NAS层提供连接管理,消息传递等服务: 对接入网的底层协议实体提供参数配 ...

  3. EPANET头文件解读系列7——MEMPOOL.H

    //EPANET应用程序使用了大量的节点与管段数据,而且每个对象数据又有不同时段的数据,这些数据占用了大量内存,而mempool.h就是一个简单快速的内存分配相关的头文件/***  mempool.h ...

  4. 基于js-spark-md5前端js类库,快速获取文件Md5值

    js-spark-md5是歪果仁开发的东西,有点多,但是我们只要一个js文件即可,具体类包我存在自己的oschina上,下载地址:https://git.oschina.net/jianqingwan ...

  5. python 列表构造时的引用问题

    以前老是不注意python对象引用,平时也没遇到这样的问题,昨天在这个小问题纠结了半天时间.真是TMD啊 先说明一下我的目的,我有一个包含16个元素的列表,每个元素也是一个小列表.我想每四个子列表为一 ...

  6. L193

    Real generosity toward the future lies in giving all to the present.将一切奉献给当下,就是对未来的真正慷慨.The wheels o ...

  7. 【python】BytesIO与串化

    一共有以下几个概念 1.类文件: File(path), open(path), BytesIO(), ... 文件读之前要seek(0) 2.字符串: file.read() 3.对象: dict, ...

  8. js字符串的裁剪

    一.JavaScript字符串的处理方法 1.split()  功能:使用一个指定的分隔符把一个字符串分割存储到数组 例子:   str=”jpg|bmp|gif|ico|png”; arr=str. ...

  9. LINUX 设置交换分区的大小

    创建交换分区目录 mkdir /data1/mnt/ 卸载当前交换分区 swapoff /data1/mnt/10GB.swap 设置交换分区为 5Gdd if=/dev/zero of=/data1 ...

  10. Spinner的用法

    1.先自定义一个数组 2.在new一个ArrayAdapter方法: ArrayAdapter<String> adapter = new ArrayAdapter<String&g ...