记得刚学习android UI的时候,让控件置底只会使用Relativelayout,有时候会让整体布局很不方便,LinearLayout布局置底的方法很简单,在此只是望和我一样的一些新手,少走些弯路了。


效果:




代码:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:background="#d8e0e8"    android:orientation="vertical" >    <ListView        android:id="@+id/msg_list_view"        android:layout_width="match_parent"        android:layout_height="0dp"        android:layout_weight="1"        android:divider="#0000" >    </ListView>    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content" >        <EditText            android:id="@+id/input_text"            android:layout_width="0dp"            android:layout_height="wrap_content"            android:layout_weight="1"            android:hint="Type somthing here"            android:maxLines="2" />        <Button            android:id="@+id/send"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="Send" />            </LinearLayout></LinearLayout>

更多相关文章

  1. android style用法
  2. android 基本布局(RelativeLayout、TableLayout等)使用方法及各种
  3. [UI]抽屉菜单DrawerLayout分析(一)
  4. Android(安卓)官方 switch 控件更改选中色
  5. android中AlertDialog设置圆角
  6. 移动开发:Android官方提供的支持不同屏幕大小的全部方法
  7. 《每天进步一点点》---android之Fragment
  8. Android入门教程(七)之五大布局对象---FrameLayout,LinearLayout
  9. Android解决多个Fragment切换时布局重新实例化问题

随机推荐

  1. Android(安卓)NDK开发之旅34--FFmpeg音频
  2. fir.im Weekly - 600个 Android(安卓)开
  3. Android之LayoutInflater加载布局及原理
  4. openssl加密
  5. Matrix详解_Matrix怎么用
  6. Android(安卓)studio使用adbwireless实现
  7. Android(安卓)UI开发第十三篇——android
  8. 在Android中利用iText生成PDF
  9. android应用基础--由官方帮助文件翻译
  10. camp