EditText被推离屏幕

时间:2018-08-09 07:29:15

标签: android android-layout android-recyclerview fragment android-softkeyboard

我的屏幕是NestedScrollView,垂直LinearLayout包含片段,Recycler和另一个片段。当我单击EditText并将其放在Recycler的一项中时,软键盘弹出并推离屏幕。该活动的windowSoftInputMode设置为stateAlwaysHidden|adjustResize

有人有没有遇到过这个问题?

布局:

<layout xmlns:android="http://schemas.android.com/apk/res/android">
  <android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background"
    >
    <LinearLayout
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      >
      <com.trinerdis.skypicker.widget.SupportFragmentLayout
        android:id="@+id/first_fragment_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />
      <android.support.v7.widget.RecyclerView
        android:id="@+id/middle_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:overScrollMode="never"
        android:scrollbars="none"
        android:listSelector="@android:color/transparent"
        android:divider="@null"
        android:dividerHeight="0dp"
        />
      <com.trinerdis.skypicker.widget.SupportFragmentLayout
        android:id="@+id/second_fragment_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="@dimen/margin_medium"
        />
      <include
        android:id="@+id/info"
        layout="@layout/layout_info"
        />
    </LinearLayout>
  </android.support.v4.widget.NestedScrollView>
</layout>

1 个答案:

答案 0 :(得分:0)

结果是我没有按照我的想法尝试所有选项,并且通过将windowSoftInputMode="stateAlwaysHidden|adjustResize"更改为windowSoftInputMode="stateAlwaysHidden|adjustPan"

解决了该问题。
相关问题