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. hdu_2224_The shortest path(dp)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2224 题意:双调欧几里德旅行商经典问题,找一条最短回路使得该路经过所有的点 题解:dp[i][j]=d ...

  2. ebtables

    ebtables是以太网桥防火墙,以太网工作在数据链路层,ebtables过滤数据链路层包.2.6内核内置了ebtables,要使用它必须先按装她的用户空间工具(ebtables-V2.0.6),安装 ...

  3. LCA-倍增法(在线)O(nlogn)-O(logn)

    1. DFS预处理出所有节点的深度和父节点 inline void dfs(int u) { int i; ;i=next[i]) { if (!deep[to[i]]) { deep[to[i]] ...

  4. excel中自动变为插入语句的写法

    =concatenate("insert into t(b,c) values('",b1,"','",c1,"');")

  5. Head First - 01.策略模式(Strategy Pattern)

    策略模式定义了算法族,分别封装起来,让它们之间可以互相替换,此模式让算法的变化独立于使用算法的客户. 当你需要给朋友留下深刻印象,或是影响关键主管的决策时,请使用“这个”定义!  设计原则: 1.找出 ...

  6. Linux SSH使用公钥私钥实现免登陆

    公钥和私钥(我是文盲,钥字之前都是读yao,这是多音字这里应该念yue),是成对出现的,一旦任何一个做了更改都会验证失败. 1.免登陆的实现:   使用下例中ssky-keygen和ssh-copy- ...

  7. .net简单的静态页生成

    1.得到实体对象model,读取模板 string htmlMaster = File.ReadAllText(HttpContext.Current.Server.MapPath("/ma ...

  8. Oracle record 解锁

    Oracle修改表中记录时出现record is locked by another user的弹出框问题 是因为在操作表中数据时没有commit,导致表被锁. 执行下面两行语句: (1)查看被锁表的 ...

  9. 滚动视图UIScrollView

    int i; @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super ...

  10. libc.so.6重做链接,删除导致的缺失问题(后期需要深入研究),未能成功升级

    中间件启动,提示/lib64/libc.so.6版本过低,升级glibc后,修改临时环境变量,结果导致sgment fault错误,根据报错 ll /lib64/ |grep libc -rwxr-x ...