RelativeLayout(相对布局)

:layout/activity_main.xml

<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" >


<TextView
android:id="@+id/tvUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用户名:"
android:layout_marginTop="15dp"
android:textSize="20dp"/>
<EditText
android:id="@+id/etUser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入1-10字符"
android:layout_toRightOf="@id/tvUser"
android:layout_alignBaseline="@id/tvUser"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/tvPass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="密 码:"
android:layout_below="@id/etUser"
android:textSize="20dp"
android:layout_marginTop="5dp"/>
<EditText
android:id="@+id/etPass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入1-10字符"
android:layout_toRightOf="@id/tvPass"
android:layout_alignBaseline="@id/tvPass"
android:layout_below="@id/etPass"
android:layout_marginTop="5dp"
/>
</RelativeLayout>

效果:

更多相关文章

  1. android度量相对于地球坐标系的加速度
  2. Android——显示Intent和隐式Intent以及IntentFilter匹配规则
  3. android开发4:Android布局管理器1(线性布局,相对布局RelativeLayou
  4. RelativeLayout(相对布局)
  5. android webservices sax 传输并解析xml
  6. android项目案例5- 基于Android(安卓)studio的android用户登陆
  7. Android(安卓)的相对布局的一些使用
  8. Android(安卓)Studio 4.0 新功能之 AndroidKotlin Live Template
  9. 线性布局和相对布局的知识点

随机推荐

  1. How-To: Install Google’s Android(安卓
  2. 关于android中Email未设置账户的情况下发
  3. Android(安卓)SDK 2.0 安装
  4. Android解析xml的Demo
  5. Android之back键拦截处理
  6. Android(安卓)Activity
  7. Android开发面试经——4.常见Android进阶
  8. android studio 中添加 Volley module
  9. Android属性之build.prop,及property_get/
  10. 微信Android客户端后台保活经验分享