Android---->RelativeLayout相对对齐方式布局
















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相对对齐方式布局的更多相关文章
- android RelativeLayout实现左中右布局
RelativeLayout实现左中右布局 <RelativeLayout android:layout_width="match_parent" android:lay ...
- 【Android学习】四种布局方式
一.LinearLayout 线性布局,即一行展开或者一列展开,也可以嵌套,需要注意的属性如下: android:orentation //对齐方式 二.FrameLayout 帧布局,即一层层叠起 ...
- Android学习笔记④——页面的布局方式
FrameLayout(帧布局) 这个布局的特点是简单的默认把每一个视图组件都放在边框内且放在左上角,即使添加多个视图组件,他们也都是重叠在左上角,新的视图会遮挡住旧的视图.可以根据gravity来改 ...
- Android开发之5大布局方式详解
Android中常用的5大布局方式有以下几种: 线性布局(LinearLayout):按照垂直或者水平方向布局的组件. 帧布局(FrameLayout):组件从屏幕左上方布局组件. 表格布局(Tabl ...
- Android学习笔记(14):相对布局RelativeLayout
相对布局RelativeLayout,继承自ViewGroup.相对布局的子组件的位置总是相对于兄弟组件或者父容器决定的. RelativeLayout支持的XML属性: android:gravit ...
- Android——RelativeLayout(相对布局)
一.相对于父容器 1.居中 2.同方向 <?xml version="1.0" encoding="utf-8"?> <RelativeLay ...
- CSS3 04. 伸缩布局、设置主轴,侧轴方向、主/侧轴对齐方式、 伸缩比例、元素换行、换行控制、覆盖父元素的align-items;控制子元素顺序、web字体、突变字体
CSS3 在布局方面做了非常大的改进,对块级元素的布局排列变得十分灵活,适应性非常强,其强大的伸缩性,在响应式开发中可以发挥极大的作用.(兼容性不好) 必要元素: 指定一个盒子为伸缩盒子 displa ...
- 【Android自学日记】五大布局常用属性
线性布局(LinearLayout)常用属性: android:orientation="vertical"--决定子类控件的排布方式(vertical垂直:horizontal水 ...
- Android UI基础之五大布局
Android UI基础之五大布局 Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦.组件按照布局的要求依次排列,就组成了用户所看见的界面.Andro ...
随机推荐
- WebViewJavascriptBridge详细使用
前言 WebViewJavascriptBridge是支持到iOS6之前的版本的,用于支持native的iOS与javascript交互.如果需要支持到iOS6之前的app,使用它是很不错的.本篇讲讲 ...
- 第十五节,基本数据类型,元组tuple
元组和列表的区别 元组和列表几乎是一样的 不一样的地方就是元组创建后元组的元素不可以修改,比如(添加,拓展,移除等修改功能,但是元组里的元素的元素是可以修改的) 基本操作: 索引 切片 循环 长度 包 ...
- IoC容器Autofac正篇之简单实例(四)
先上一段代码. namespace ConsoleApplication3 { class Program { static void Main(string[] args) { ContainerB ...
- varnish缓存安装使用
varnish PDF http://files.cnblogs.com/jimingsong/varnish.pdf 目前介绍CentOS6.4-64位系统 yum安装varnish: 配置varn ...
- Away 3d 基本属性
出处:http://blog.sina.com.cn/s/blog_59f0ac9d0101ci2j.html View3D在初始化时候就已经创建的Camera3D 所以有时候没有创建Camera3D ...
- ios导航栏适配
我们做屏幕导航栏横竖屏适配的时候,会发现top的值多少都有一点的偏移,加了背景色之后从0开始,不加背景色从64开始,解决方法self.extendedLayoutIncludesOpaqueBars ...
- 网站的性能优化与安全(高效C#编码优化)
1. Foreach 比 For 性能高30%2. 避免是使用ArrayList, 因为任何对象到ArrayList都有封装为Object,出来还要拆箱. 用泛型去掉3. HashTalbe取代 ...
- ckediter
ckediter ##<link rel='stylesheet' href='/css/index.css' /> <script type="text/javascri ...
- 转 Oracle12c/11个 Client安装出现"[INS-30131]"错误“请确保当前用户具有访问临时位置所需的权限”解决办法之完整版
错误分析:安装时exe会自动解压到C:\Users\Administrator\AppData\Local\Temp再进行安装,当文件夹权限不足时就会拒绝安装程序的访问: 第一步: 在win+R输入 ...
- VMI
在虚拟机外部监控虚拟机内部运行状态的方法被称为虚拟机自省(Virtual Machine Introspection,VMI).VMI允许特权域查看非特权域的运行状态,并能获得被监控虚拟机运行状况相关 ...