android第一天
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>
效果:
本文出自 “追随心的彼岸” 博客,谢绝转载!
更多相关文章
- android 解析xml字符串
- android 根据TextView宽度 自动缩小字体大小 以适应其宽度
- android表情Gson EditText TextView
- android字符串 优化(一)
- Android(安卓)调用Gmail发送邮件
- android 利用socket 发送Json数据demo
- android联系人过滤
- Android发送短信
- Android时间工具类 本地转UTC,UTC转本地