Java 软键盘的建议条隐藏了部分布局
我已经尝试了几乎所有的软键盘解决方案,在弹出视图时覆盖部分视图,在进一步的调查中,我发现覆盖布局的不是键盘而是建议条。 但从键盘设置中禁用建议条似乎是唯一的解决方案 我曾经尝试过一些技巧,当键盘弹出时在运行时添加填充,但似乎都不起作用 下面的代码段来自我的BottomSheetDialog:Java 软键盘的建议条隐藏了部分布局,java,android,kotlin,keyboard,Java,Android,Kotlin,Keyboard,我已经尝试了几乎所有的软键盘解决方案,在弹出视图时覆盖部分视图,在进一步的调查中,我发现覆盖布局的不是键盘而是建议条。 但从键盘设置中禁用建议条似乎是唯一的解决方案 我曾经尝试过一些技巧,当键盘弹出时在运行时添加填充,但似乎都不起作用 下面的代码段来自我的BottomSheetDialog: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.wid
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/design_bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/feedback_text"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/recognition_text_box_border_drawable"
android:gravity="start"
android:hint="@string/manager_recognition_edit_text_hint"
android:importantForAutofill="no"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="200"
android:maxLines="24"
android:overScrollMode="always"
android:padding="8dp"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical"
android:textColor="@android:color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/award_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="@id/feedback_text"
app:layout_constraintEnd_toEndOf="@id/feedback_text"
app:srcCompat="@drawable/trophy_golden" />
<include
android:id="@+id/award_badge_item"
layout="@layout/award_badge_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="@id/feedback_text"
app:layout_constraintStart_toStartOf="@id/feedback_text" />
<LinearLayout
android:id="@+id/buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="horizontal"
android:weightSum="3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/feedback_text">
<Button
android:id="@+id/cancel_recognition"
style="@style/Widget.AppCompat.Button"
android:layout_width="0dp"
android:layout_height="@dimen/medium_button_height"
android:layout_margin="4dp"
android:layout_weight="1"
android:text="@android:string/cancel" />
<Button
android:id="@+id/send_recognition"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="0dp"
android:layout_height="@dimen/medium_button_height"
android:layout_margin="4dp"
android:layout_weight="2"
android:text="@string/send_recognition" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
在清单活动标记中打开键盘的位置添加此行
android:windowSoftInputMode="stateHidden|adjustResize"
你能在这里粘贴xml和java代码吗?B'coz我已经设计了一些布局,并将布局打开到警报对话框(重力=底部),建议条显示在软键盘上方(软键盘没有隐藏任何部分)@mdroid23我已经为BottomSheetDialogThank添加了xml代码,但正如我前面所述,我已经尝试了所有可能的解决方法,包括这个,但到目前为止都没有成功。