android - 当 android:windowSoftInputMode="adjustNothing" 时将回收器视图滚动到底部
问题描述
活动布局。
<android.support.design.widget.CoordinatorLayout>
<ViewPager
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.AppBarLayout>
<android.support.design.widget.CollapsingToolbarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
/>
<ImageView
/>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
并且ViewPager
包含一个片段,其布局如下:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/fl_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/btn_done"
android:layout_alignParentTop="true" />
<Button
android:id="@+id/btn_done"
android:layout_width="match_parent"
android:layout_height="40dp"
/>
</RelativeLayout>
<include layout="@layout/some_other_layout" />
<include layout="@layout/some_other_layout" />
</FrameLayout>
问题是当RecyclerView
项目应该滚动到键盘顶部时应该隐藏按钮,因为它的视图底部有按钮可以动态添加新视图。我什至试着把它放在RecyclerView
下面NestedScrollView
,但没有任何反应。
中的项目
RecyclerView
是这样的
ITEM
ITEM
ITEM
+ Button完成按钮
完成按钮需要隐藏在键盘后面,但视图的其余部分需要在键盘上方滚动。为了保持在它的位置。我已经用于
adjustNothing
活动。但我的问题是RecyclerView
项目也被隐藏在键盘后面。
解决方案
推荐阅读
- python - 检查变量的十进制值是否无限
- reactjs - 使用 OAI 拒绝 Cloudfront 访问
- reactjs - react-reveal 包不能多次触发吗?
- firebase - 导航到另一个页面后,Flutter Firebase 不退出
- reactjs - 我需要部署什么配置来响应 https 服务器?
- reactjs - useLeafletContext() 只能用于
- lodash - 我如何将 lodash flow 与 find 一起使用?
- python - Pandas 使用字典和正则表达式替换
- python - tensorflow.python.framework.errors_impl.AlreadyExistsError
- javascript - Angular Http Get 请求返回 Array(2)[Object, Object] 但未定义