RecyclerView占据了所有屏幕空间

RecyclerView占据了所有屏幕空间,第1张

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(如果它是根目录中的相对布局或线性布局,并且在视图中还有其他内容)。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5133078.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存