读书人

RelativeLayout的格局学习(部分知识点)

发布时间: 2012-11-10 10:48:50 作者: rapoo

RelativeLayout的布局学习(部分知识点)
1.这个是APIDemo中的布局格式:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent">    <TextView        android:id="@+id/label"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="Type here:"/>    <EditText        android:id="@+id/entry"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:background="@android:drawable/editbox_background"        android:layout_below="@id/label"/>    <Button        android:id="@+id/ok"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_below="@id/entry"        android:layout_alignParentRight="true"        android:layout_marginLeft="10dip"        android:text="OK" />    <Button        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_toLeftOf="@id/ok"        android:layout_alignTop="@id/ok"        android:layout_above="@id/ok"        android:text="Cancel" /></RelativeLayout>


1.这里面比较有用的部分1)
android:background="@android:drawable/editbox_background"

2.android:layout_marginLeft="10dip"是设定后续如果有放在左面的View就默认间隔10dp的距离;
引号里的内容麻烦楼主可以再解释一下吗?

读书人网 >其他相关

热点推荐