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>
效果:
?
?
轉載于:https://www.cnblogs.com/qa962839575/p/4148616.html
總結
以上是生活随笔為你收集整理的android第一天的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Robotium只有apk文件测试实例
- 下一篇: MySQL批量插入数据的几种方法