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 ...
随机推荐
- Eclips安装SVN插件
1.eclipse -> Help ->Install New Software->add 2.弹出窗的"Name"和"URL"中输入如下内容 ...
- java并发编程:线程安全管理类--原子操作类--AtomicInteger
在java并发编程中,会出现++,--等操作,但是这些不是原子性操作,这在线程安全上面就会出现相应的问题.因此java提供了相应类的原子性操作类. 1.AtomicInteger
- 旋转木马幻灯片切换效果JS源码详解
首先,放上慕课网的课程链接,源码是在这个课程里分享出来的,https://www.imooc.com/learn/386. 文章适合学习过这个课程的同学,再看这篇文章,可能有更深入的理解.主要是对各种 ...
- POJ 3414 Pots 暴力,bfs 难度:1
http://poj.org/problem?id=3414 记录瓶子状态,广度优先搜索即可 #include <cstdio> #include <cstring> #inc ...
- hdu 3268 09 宁波 现场 I - Columbus’s bargain 读题 最短路 难度:1
Description On the evening of 3 August 1492, Christopher Columbus departed from Palos de la Frontera ...
- css之grid layout代码解释
.wrapper { display: grid; grid-template-columns: repeat(3, 1fr);/*grid-template-columns CSS属性定义了网格列的 ...
- SSRS 在使用矩阵的时候,隐藏掉一列空白值
SSRS 在使用矩阵的时候会因为数据集中含有NULL导致出现一列空白值 数据结果如图: 然后以houseid 作为矩阵组列,productcode作为行, 列名196前面多出就是NUll的列,那么我们 ...
- springboot---没有配置数据库启动报错
If you want an embedded database please put a supported one on the classpath. If you have database s ...
- UE4 游戏中csv配置文件使用
本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接: http://blog.csdn.net/cartzhang/article/details/76549463 作者:ca ...
- 为什么有logistics函数
直观地看: 如果是softmax函数,我想有跟多的选择方向吧