栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

RecyclerView占据了所有屏幕空间

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

RecyclerView占据了所有屏幕空间

将根视图更改为frameLayout。将LinearLayout的重力设置为底部

<frameLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"><android.support.v7.widget.RecyclerView    android:id="@+id/chat_listview"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:paddingRight="@dimen/abc_action_bar_default_padding_material"    android:paddingLeft="@dimen/abc_action_bar_default_padding_material"/><LinearLayout    android:layout_below="@id/chat_listview"    android:layout_width="match_parent"    android:layout_height="@dimen/bottom_bar_height"    android:layout_gravity="bottom"    android:orientation="horizontal">    <EditText        android:id="@+id/chat_input_edittext"        android:layout_weight="7"        android:layout_width="0dp"        android:layout_height="match_parent"        android:inputType="textAutoCorrect"/>    <Button        android:id="@+id/chat_send_button"        android:layout_weight="1"        android:layout_width="0dp"        android:layout_height="match_parent"        android:background="@drawable/ic_action_send_now"/>    </LinearLayout></frameLayout>

或者,您可以将线性布局包装在frameLayout中,并将其设置为align_parentBottom =
true(如果它是根目录中的相对布局或线性布局,并且在视图中还有其他内容)。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/438336.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号