Java Android:Recyclerview在软输入键盘出现时不调整大小
我有一个包含片段的活动,该片段包含一个customview。customview包含一个edittext,其正下方是一个高度为match_parent的recyclerview。当用户关注编辑文本时,会出现一个软输入键盘。。不幸的是,这个键盘下面隐藏了一半的recyclerview。我想让recyclerview调整到屏幕的剩余可见高度(在edittext下),这样列表中的项目就不会被键盘隐藏 我已尝试在清单中为活动设置adjustresize,但没有效果:Java Android:Recyclerview在软输入键盘出现时不调整大小,java,android,user-interface,android-recyclerview,Java,Android,User Interface,Android Recyclerview,我有一个包含片段的活动,该片段包含一个customview。customview包含一个edittext,其正下方是一个高度为match_parent的recyclerview。当用户关注编辑文本时,会出现一个软输入键盘。。不幸的是,这个键盘下面隐藏了一半的recyclerview。我想让recyclerview调整到屏幕的剩余可见高度(在edittext下),这样列表中的项目就不会被键盘隐藏 我已尝试在清单中为活动设置adjustresize,但没有效果: android:windowSoft
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.AppCompat.NoActionBar"
我已尝试将我的应用程序主题设置为基本主题(以防自定义主题中的某些内容导致问题)-没有效果:
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.AppCompat.NoActionBar"
我已经检查了以确保在层次结构下的任何地方都没有需要调整大小的框架布局(我读了一篇文章,所以可能会有问题)——没有
我已经检查了活动、片段、customview和每个连接的适配器,以确保我没有在任何地方调用getWindow(我没有)
customview在运行时从viewstub膨胀。这有线路吗
编辑:
家长的内容:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
...
<ViewStub
android:id="@+id/viewstub_outername"
android:layout="@layout/viewstub_thatIneed"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
不要在清单文件中执行任何操作。只用
((LinearLayoutManager)recyclerView.getLayoutManager()).setStackFromEnd(true);
这将解决recyclerview的大小调整问题。请发布演示问题的代码片段。@GaneshKumar请参阅我的editHey@Jon,您找到解决此问题的方法了吗?我也面临同样的问题。你的解决方案解决了我的问题,其他解决方案没有解决我的问题。谢谢!惊人的解决方案。尝试调整大小或隐藏等但失败后,这一次节省了时间。安卓总是让我惊讶哈哈:你是我的上帝。非常感谢。当顶部有edittext时,这会弄乱RecycelView。recylerview会滚动,但视图不可见