RelativeLayout—相对布局
来源:互联网 发布:linux locale命令i18n 编辑:程序博客网 时间:2024/05/20 13:38
•相对布局内的子组件的位置总是相对于兄弟组件或父容器的位置来确
定。供子组件使用的主要属性:
•子组件相对于父容器
•android:layout_alignParentLeft="true":在父元素内左边
•android:layout_alignParentRight="true":在父元素内右边
•android:layout_alignParentTop="true":在父元素内顶部
•android:layout_alignParentBottom="true":在父元素内底部
•子组件相对于兄弟组件
•android:layout_below="@id/aaa":在指定View的下方
•android:layout_above="@id/xxx":在指定View的上方
•android:layout_toLeftOf="@id/bbb":在指定View的左边
•android:layout_toRightOf="@id/cccc":在指定View的右边
RelativeLayout—相对布局
•子组件的对齐方式:
•android:layout_centerInParent="true":居中布局
•android:layout_centerVertical="true":垂直居中布局
•android:layout_centerHorizontal="true":水平居中布局
•android:layout_alignTop="@id/xxx":不指定View的上边界一致
•android:layout_alignBottom="@id/xxx":不指定View下边界一致
•android:layout_alignLeft="@id/xxx":不指定View的左边界一致
•android:layout_alignRight="@id/xxx":不指定View的右边界一致
•Activity全屏
•android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"
•Activity去标题栏
•android:theme="@android:style/Theme.Holo.Light.NoActionBar "
<?xmlversion="1.0"encoding="utf-8"?>
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/framelayout_title"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#536D86"
android:background="@drawable/bar_bg"
android:gravity="center"/>
<ImageViewandroid:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/btn_edit"
android:layout_alignLeft="@id/tv_1"
android:layout_alignTop="@id/tv_1"
android:contentDescription="@string/blank"
android:layout_gravity="left|top"/>
<ImageViewandroid:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/btn_refresh"
android:layout_alignRight="@id/tv_1"
android:layout_alignTop="@id/tv_1"
android:contentDescription="@string/blank"
android:layout_gravity="left|top"/>
</RelativeLayout>
- RelativeLayout—相对布局
- RelativeLayout——相对布局
- RelativeLayout 相对布局
- 相对布局(RelativeLayout)
- RelativeLayout相对布局
- RelativeLayout相对布局
- RelativeLayout相对布局
- RelativeLayout相对布局
- 关于相对布局RelativeLayout
- Android 相对布局:RelativeLayout
- android 相对布局RelativeLayout
- android 相对布局 RelativeLayout
- 浅谈RelativeLayout相对布局
- RelativeLayout相对布局
- RelativeLayout相对布局学习
- RelativeLayout相对布局
- RelativeLayout相对布局
- RelativeLayout(相对布局)
- android 蓝牙开发
- Yii查询多条固定数据
- HDU4787--GRE Words Revenge(在线AC自动机)
- 第三方支付风控系统的演进过程
- LR的web_reg_save_param详解
- RelativeLayout—相对布局
- 关于xlib按键事件(KeyPress, KeyRelease)自动重复的解决方法
- restful 关于Restful Web Service的一些理解
- java 解析xml的四种方式
- MySQL索引原理及慢查询优化
- Flex4中想要去除AdvancedDataGrid表头部分的竖型分割线
- 森纵sap怎么样,是骗人的
- 原型prototype
- cocs2dx richtext