【发布时间】:2019-01-27 23:59:48
【问题描述】:
我的应用中有一个 BottomSheet,用户需要使用软键盘输入一些数据。但是,当软键盘出现时,底部工作表隐藏在相同的后面。每当出现软键盘时,我都希望将其向上推。
我在清单中添加了以下内容。
android:windowSoftInputMode="adjustResize"
这里是 XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical">
<TextView
android:id="@+id/tv_selected_font"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Choose a font"
android:padding="8dp"
android:gravity="center"/>
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:queryHint="Select"
android:tooltipText="Tap to select"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_f_chicken"
android:layout_width="match_parent"
android:layout_height="200dp"
android:visibility="visible" />
</LinearLayout>
但是,同样的方法不起作用。您的帮助/支持将不胜感激。谢谢
【问题讨论】:
标签: java android kotlin bottom-sheet