EditText 被推离屏幕
EditText gets pushed off screen
我的屏幕 NestedScrollView
垂直 LinearLayout
包含片段,Recycler
和另一个片段。当我单击 EditText
并将焦点放在 Recycler 的其中一项时,会弹出软键盘并将其推出屏幕。对于 activity,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>
原来我没有像我想的那样尝试所有选项,通过将 windowSoftInputMode="stateAlwaysHidden|adjustResize"
更改为 windowSoftInputMode="stateAlwaysHidden|adjustPan"
问题得到解决
我的屏幕 NestedScrollView
垂直 LinearLayout
包含片段,Recycler
和另一个片段。当我单击 EditText
并将焦点放在 Recycler 的其中一项时,会弹出软键盘并将其推出屏幕。对于 activity,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>
原来我没有像我想的那样尝试所有选项,通过将 windowSoftInputMode="stateAlwaysHidden|adjustResize"
更改为 windowSoftInputMode="stateAlwaysHidden|adjustPan"