学了一个星期的基本控件和简单布局了,今天自己动手画一个简单的登录界面。
在画的过程中发现了自己很多用法理解错误,在完成界面过程中将已学的控件和布局几乎都用了,让自己对控件和布局有了更进一步的理解。
1.首先用个线性布局,再在里面嵌套。
2.下图用到线性布局的水平布局,然后用到一个ImageView,一个TextView
XML:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="45dp"
android:background="@drawable/head"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:src="@drawable/back" >
</ImageView>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:gr