【问题标题】:Bottom-sheet is hidden behind the soft keyboard底页隐藏在软键盘后面
【发布时间】: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


    【解决方案1】:

    你可以用滚动视图包裹你的底部布局,遇到同样的问题,滚动视图就可以了。您也可以提供您的 xml,以便我们提供更多帮助

    【讨论】:

    • 感谢您的回复。我已经用 XML 更新了查询。
    • 您是否尝试过将滚动视图设为父布局?
    猜你喜欢
    • 2021-07-23
    • 2011-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-22
    • 1970-01-01
    • 2016-10-22
    • 1970-01-01
    相关资源
    最近更新 更多