相对布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:padding="5dp"
android:gravity="center_horizontal"
// 上面gravity属性的参数:center为居中,center_horizontal为水平居中,center_vertical为垂直居中
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="60dp"
android:layout_height="wrap_content"
android:text="@string/number"
android:id="@+id/numberlabel"
android:layout_marginTop="5dp"/>
<EditText
android:inputType="number"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/number"
android:labelFor="@id/number"
android:layout_toRightOf="@id/numberlabel"
android:layout_marginLeft="5dp"
/>
</RelativeLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/content" />
<EditText
android:inputType="textMultiLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/content"
android:labelFor="@id/content"
android:minLines="3"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button"
android:text="@string/button"
/>
</LinearLayout>
效果图:
分享到:
相关推荐
Android 相对布局实例 ,RalateLayout
这个程序写了对相对布局和绝对布局的例子,帮助大家理解两者的使用和区别。
android相对布局资源属性 包括各种位置 相对位置 布局 属性 的设置 和 例子
Android 相对布局 RelativeLayout 属性
Android相对布局RelativeLayout的基本用法,相对布局是最实用的布局。
在android项目设计中,需要用到的一种布局方式,那就是相对布局。
一个利用相对布局编写的石头剪刀布小游戏。左右选择后,点击开始可得结果。比较傻瓜,适合初学者。
用Android Studio 2.3.3做的相对布局例子,主要用到的标签有:<RelativeLayout></RelativeLayout>;主要用到的设置有android:id、android:layout_below、android:layout_alignParentRight和android:layout_toLeftOf...
关于android的基本界面设置, 练习线性布局和相对布局的使用 2.理解Android开发的方法
android相对布局详解
NULL 博文链接:https://sunzone.iteye.com/blog/1858186
自己写的android相对布局demo,具体参照博客
RelativeLayout是相对布局控件:以控件之间相对位置或相对父容器位置进行排列,下面通过本文给大家介绍Android布局之RelativeLayout相对布局,涉及到android relativelayout相对布局相关知识,对android ...
RelativeLayout 相对布局 子组件的位置总是相对兄弟组件,父容器来决定的 FrameLayout 帧布局、框架布局 创建一个空白区域, 一个区域成为一帧 TableLayout 表格布局 采用 行, 列 形式管理子组件,添加TableRow 和 ...
NULL 博文链接:https://leequer.iteye.com/blog/604985
介绍Android五中布局的一个示例代码.
Android4.2 相对布局实现简单的登录界面
相对布局(RelativeLayout):相对其它组件的布局方式。 绝对布局(AbsoluteLayout):按照绝对坐标来布局组件。 1. 线性布局 线性布局是Android开发中最常见的一种布局方式,它是按照垂直或者水平方向来布局...
Android移动应用开发相对布局RelativeLayout的特点.pdf 学习资料 复习资料 教学资源
《老罗Android开发视频教程》第四集:android相对布局的使用.mp4 《老罗Android开发视频教程》第四集:android生命周期的介绍.avi 《老罗Android开发视频教程》第四集:android使用fastjson解析.mp4 《老罗Android...