main.xml应用布局分析

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#0000FF"
android:padding="10px"
>
<TextView
android:id="@+id/tv01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:text="Type here:"
/>
<EditText
android:id="@+id/txt01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv01"
/>
<Button
android:id="@+id/btn01"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/txt01"
android:layout_alignParentRight="true"
android:text="OK"
/>
<Button
android:id="@+id/btn02"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/txt01"
android:layout_toLeftOf="@id/btn01"
android:layout_marginRight="30dp"
android:text="Cancel"
/>
</RelativeLayout>

注意的是:相对布局不能产生循环布局

Android---->RelativeLayout相对对齐方式布局的更多相关文章

  1. android RelativeLayout实现左中右布局

    RelativeLayout实现左中右布局   <RelativeLayout android:layout_width="match_parent" android:lay ...

  2. 【Android学习】四种布局方式

    一.LinearLayout 线性布局,即一行展开或者一列展开,也可以嵌套,需要注意的属性如下: android:orentation  //对齐方式 二.FrameLayout 帧布局,即一层层叠起 ...

  3. Android学习笔记④——页面的布局方式

    FrameLayout(帧布局) 这个布局的特点是简单的默认把每一个视图组件都放在边框内且放在左上角,即使添加多个视图组件,他们也都是重叠在左上角,新的视图会遮挡住旧的视图.可以根据gravity来改 ...

  4. Android开发之5大布局方式详解

    Android中常用的5大布局方式有以下几种: 线性布局(LinearLayout):按照垂直或者水平方向布局的组件. 帧布局(FrameLayout):组件从屏幕左上方布局组件. 表格布局(Tabl ...

  5. Android学习笔记(14):相对布局RelativeLayout

    相对布局RelativeLayout,继承自ViewGroup.相对布局的子组件的位置总是相对于兄弟组件或者父容器决定的. RelativeLayout支持的XML属性: android:gravit ...

  6. Android——RelativeLayout(相对布局)

    一.相对于父容器 1.居中 2.同方向 <?xml version="1.0" encoding="utf-8"?> <RelativeLay ...

  7. CSS3 04. 伸缩布局、设置主轴,侧轴方向、主/侧轴对齐方式、 伸缩比例、元素换行、换行控制、覆盖父元素的align-items;控制子元素顺序、web字体、突变字体

    CSS3 在布局方面做了非常大的改进,对块级元素的布局排列变得十分灵活,适应性非常强,其强大的伸缩性,在响应式开发中可以发挥极大的作用.(兼容性不好) 必要元素: 指定一个盒子为伸缩盒子 displa ...

  8. 【Android自学日记】五大布局常用属性

    线性布局(LinearLayout)常用属性: android:orientation="vertical"--决定子类控件的排布方式(vertical垂直:horizontal水 ...

  9. Android UI基础之五大布局

    Android  UI基础之五大布局 Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦.组件按照布局的要求依次排列,就组成了用户所看见的界面.Andro ...

随机推荐

  1. 查看apk包及Activity名方法

    查看apk包名方法activity名: 方法一: aapt dump badging +客户端包所在路径+客户端包名称 如: aapt.exe dump badging K:\Apk\fanxing. ...

  2. cPanel 安装方法

    . 如何安装cPanel/WHM? 答:安装过程较长,建议使用screen或nohupscreen: yum -y install screen perl screen -S cpanel cd /h ...

  3. java常量和变量的定义规则,变长参数的使用

    首先是定义的一般规则,类名首字母全部大写,常量全部大写用下划线分隔,变量用驼峰形式.注意使用long赋值用L时不能写小写的L要写大写的,不然会和数字“1”傻傻分不清. 下面是举例: public cl ...

  4. ios图片剪切

    #import "ViewController.h" @interface ViewController ()@property (weak, nonatomic) IBOutle ...

  5. 学习最短路建图 HUD 5521

    http://acm.hdu.edu.cn/showproblem.php?pid=5521 题目大意:有n个点,m个集合,每个集合里面的点都两两可达且每条边权值都是val,有两个人A, B,A在po ...

  6. 线段树 或者 并查集 Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) C

    http://codeforces.com/contest/722/problem/C 题目大意:给你一个串,每次删除串中的一个pos,问剩下的串中,连续的最大和是多少. 思路一:正方向考虑问题,那么 ...

  7. linux git升级到1.8.3

    1. Download PUIAS repo: wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitla ...

  8. coco2d-x CCDirector.h文件中变量*m_pNotificationNode*

    1.在CCDiretor.h中有如下说明 /** This object will be visited after the main scene is visited. This object MU ...

  9. 新建aix实例

    http://www.cnblogs.com/kfarvid/archive/2010/12/21/1912553.html   DB2数据库 http://wenku.baidu.com/view/ ...

  10. javascript语句语义大全(2)

    1. 四则运算相关 +,-,*,/,% 分别是加减乘除和取余 2.Math.pow(a,b) a的b次方 3.toFixed(a) 四舍五入为指定小数位数的数字 4. k++; ++K 看似相同但是在 ...