RelativeLayout
来源:互联网 发布:二叉树的反转Java 编辑:程序博客网 时间:2024/06/16 22:02
注意:第二个EditText中layout_align——为什么要这样写。使拖动第一个EditText时候,与第二个EditText的相对位置不会发生变化。
<RelativeLayout 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:padding="15dp" > <TextView android:id="@+id/lableView" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="登陆界面"/> <EditText android:id="@+id/usernameText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:hint="username" android:layout_below="@id/lableView" /><EditText android:id="@+id/passwordText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@id/usernameText" android:layout_alignRight="@id/usernameText" android:hint="password" android:inputType="textPassword" android:layout_below="@id/usernameText" /><Button android:id="@+id/cancelButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/passwordText" android:layout_alignParentRight="true" android:text="取消" /><Button android:id="@+id/okButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@id/cancelButton" android:layout_toLeftOf="@id/cancelButton" android:text="确定" /></RelativeLayout>
效果图:
0 0
- ‘RelativeLayout’
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- Relativelayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- RelativeLayout
- redhat6.0 安装G++
- Swift学习记录 - Alamofire 4.0.1网络库基本使用(持续更新...)
- TextRank 提取关键字、提取关键短语、提取摘要
- Ubuntu 中创建SWAP交换分区文件
- Servlet3.0中Servlet的使用
- RelativeLayout
- Android是如何管理App内存的--Android内存优化第二弹
- 一道面试题
- 关于理解middlebury提供的立体匹配代码后的精减
- android SQLite 数据存储
- 数据结构实验之图论八:欧拉回路
- Netty系列之Netty百万级推送服务设计要点
- iOS ipa提交中断后无法再次提交
- 将整数数组进行m等分,使得每一个部分的和相等且m最大