相对布局
来源:互联网 发布:友价房产源码 编辑:程序博客网 时间:2024/04/27 16:44
在相对布局中,个人觉得一个控件至少也要指定它的两处相对位置关系才可确定它的位置
<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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" ><!-- 一般需要指定至少两个相对位置才能确定一个控件的具体位置 --> <!-- 添加一个居中显示的文本视图 --> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" android:layout_centerInParent="true" /><!--添加一个在button2左侧的按钮 --><Button android:id="@+id/button1" android:layout_toLeftOf="@+id/button2" android:layout_below="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="左侧按钮" /><Button android:id="@+id/button2" android:layout_below="@+id/textView1" android:layout_alignRight="@+id/textView1"android:text="右侧按钮"android:layout_width="wrap_content"android:layout_height="wrap_content"/></RelativeLayout>
0 0
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- 相对布局
- Android 布局:相对布局
- android相对布局 相对对齐
- 线性布局 相对布局 参数
- MapReduce中的分区方法Partitioner
- 【CTO辩论会】移动开发者忠于技术or 背离技术
- Java中的static
- nginx 反向代理和负载均衡
- DetachedCriteria多条件查询or,disjunction
- 相对布局
- 在mac OS上通过终端命令显示文件夹路径
- [C++设计模式] strategy 策略模式
- 使用PLSql连接Oracle时报错ORA-12541: TNS: 无监听程序
- Unity3D项目程序加密2——对dll进行混淆
- android textview 实现跑马灯效果
- 1005. Spell It Right (20)
- HDU 5282 Senior's String (两次dp LCS预处理)
- Android Studio SDK 更新方法