相对布局
<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>


效果图:

更多相关文章

  1. Android(安卓)设置虚线分割线
  2. android布局属性详解
  3. ImageVIew 设置图片大小
  4. RelativeLayout属性详解
  5. 设置TextView文字居中
  6. Android(安卓)众多的布局属性详解
  7. Android(安卓)众多的布局属性详解
  8. LinearLayout布局实现垂直水平居中
  9. android:scaleType、android:layout_alignBottom、layout_below

随机推荐

  1. Mysql 切换数据存储目录的实现方法
  2. mysql 5.7版本修改密码的简单方法
  3. Win7x64下Mysql5.7.18解压版的安装方法
  4. Windows 10系统下彻底删除卸载MySQL的方
  5. MySQL中的数据类型binary和varbinary详解
  6. Mysql 5.5.56版本(二进制包安装)自定义安装
  7. Mysql 5.6添加修改用户名和密码的方法
  8. Mysql5.7.18版本(二进制包安装)自定义安装
  9. centos 6.9安装mysql的详细教程
  10. 详解MySQL分组排序求Top N