1.嵌套在ScrollView中
example:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0">

<TextView
android:layout_height="wrap_content"
android:layout_weight="0.05"
android:text="People"
android:singleLine="true" />
<ScrollView
android:layout_weight="0.8"
android:layout_width="0px"
android:layout_height="fill_parent">
<MultiAutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</ScrollView>

<Button
android:layout_width="0px"
android:layout_weight="0.15"
android:layout_height="wrap_content"
android:text="Add"
android:onClick="onAdd" />
</LinearLayout>

<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="100px">

<EditText
android:layout_width="0px"
android:layout_weight="0.75"
android:layout_height="fill_parent"/>

<Button
android:layout_width="0px"
android:layout_weight="0.25"
android:layout_height="fill_parent"
android:text="send"
android:onClick="onSend" />

</LinearLayout>
</LinearLayout>

2. android:maxLines + android:scrollbars
example:
<TextView
android:id="@+id/text_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLines="5"
android:scrollbars="vertical"
/>

更多相关文章

  1. ScrollView嵌套RecyclerView冲突解决
  2. 带weight的LinearLayout嵌套RecyclerView导致RecycleView执行多
  3. 在LinearLayout中嵌套RelativeLayout来设置Button的位置(xml文件)
  4. Android WebView嵌套Html 之一
  5. Android应用的LinearLayout中嵌套RelativeLayout的布局用法
  6. Android LinearLayout 嵌套 button 监听LinearLayout的onClickLi
  7. android ListView嵌套checkbox并取代checkbox点击事件
  8. android LinearLayout嵌套 button时onClickListener不响应的问题

随机推荐

  1. Android输入子系统之启动过程分析
  2. Android消息推送简介
  3. Android学习路线总结,绝对干货
  4. Android实现程序前后台切换效果
  5. android主流UI布局
  6. android looper介绍
  7. Android(安卓)adb不是内部或外部命令 问
  8. Dex2jar 与 JD-GUI快速反编译Android(安
  9. Android通过软解码播放视频
  10. 分析Android(安卓)根文件系统启动过程(ini