RelativeLayout的布局学习(部分知识点)
16lz
2021-12-04
1.这个是APIDemo中的布局格式:
1.这里面比较有用的部分1)
android:background="@android:drawable/editbox_background"
2.android:layout_marginLeft="10dip"是设定后续如果有放在左面的View就默认间隔10dp的距离;
<?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的距离;
更多相关文章
- Android基础UI之ImageView宽度设定,高度自适应
- Android修改屏幕亮度
- android之布局xml各种控件属性详解
- Android(安卓)设定横屏,禁止屏幕旋转,Activity重置 [更新视频播放
- Android(安卓)shape使用详解
- android一些有用的View属性
- 浅谈android的selector,背景选择器(看着有用就转载了)
- android 游戏OpenGL学习笔记1
- Android(安卓)Studio推荐几个非常有用的工具