线性布局是一个视图组,它所有的子视图都在一个方向对齐,水平或者垂直。

你可以指定布局的方向通过android:orientation 属性。、

Tips: 注意点:android中的LinearLayout使用时,当一行填满时候,不会自动换行,

出的将不会被显示。

代码:

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:orientation="vertical"    android:paddingLeft="16dip"    android:paddingRight="16dip" >    <EditText        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:hint="@string/to" />    <EditText        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:hint="@string/subject" />    <EditText        android:layout_width="fill_parent"        android:layout_height="0dp"        android:layout_weight="1"        android:gravity="top"        android:hint="@string/message" />    <Button        android:layout_width="100dp"        android:layout_height="wrap_content"        android:layout_gravity="right"        android:text="@string/send" /></LinearLayout>
截图如下:

更多相关文章

  1. 安卓布局文件中控件的各种属性的含义
  2. 日历视图的XML属性
  3. android排版(布局)
  4. android 屏幕方向切换 锁定方向
  5. android 布局特殊的属性介绍
  6. android 布局总结
  7. 自己归纳 Android 四种布局简介

随机推荐

  1. Android ScrollView滚动条
  2. android sdk的快速安装法
  3. Android基本控件TextView
  4. Android应用程序的debug属性
  5. GridView相关
  6. Android Activity 的四种启动模式 lunchM
  7. android 布局学习
  8. Android(安卓)网络图片加载
  9. Android ListView 设置
  10. 海康威视Android SDK,即萤石Android SDK