Android入门之相对布局(RelativeLayout)
2013-08-23 09:42
513 查看
<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="30dp" > <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>
效果如下:
相关文章推荐
- Android入门之相对布局(RelativeLayout)
- 第13章、布局Layouts之RelativeLayout相对布局(从零开始学Android)
- 第13章、布局Layouts之RelativeLayout相对布局(从零开始学Android)
- Android相对布局RelativeLayout各属性介绍
- Android布局之RelativeLayout(相对布局)
- Android学习笔记之RelativeLayout(相对布局),android ListView 几个重要属性
- Android开发-RelativeLayout内多次引用同一个RelativeLayout,相对布局
- android中的相对布局RelativeLayout
- Android界面资料篇——RelativeLayout相对布局(转)
- 第13章、布局Layouts之RelativeLayout相对布局(从零开始学Android)
- android相对布局(RelativeLayout)属性详解
- android 布局之RelativeLayout(相对布局)
- Android之RelativeLayout(相对布局)
- Android相对布局RelativeLayout,Intent用法,Intent传值(对象),Intent.action大全
- Android常用布局——相对布局RelativeLayout各属性介绍
- Android开发重点难点:RelativeLayout(相对布局)详解
- Android相对布局RelativeLayout的基本用法
- 从零开始学android<RelativeLayout相对布局.十六.>
- Android布局RelativeLayout(相对布局)详解
- 再学习---Android相对布局(RelativeLayout)