How to keep a bottom nav bar from being pushed up on keyboard shown

后端 未结 5 2089
野的像风
野的像风 2021-02-03 20:20

How can i create a sticky footer that wont be moved up with the view when the softkey keyboard popups up?

Below is an image example of my current setup and what i want

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-03 21:21

    I am very late to answer but I ran into same situation lately. I followed another approach to solve this issue and that was rather than using RelativeLayout or LinearLayout, using CoordinatorLayout and having behavior applied to BottomNavigtaionView to show/hide it with scrolling to top or bottom (the same way we see CollapsingToolBar or AppBarLayout).

    The built in behavior used for BottomNavigationView is app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"

    You can read all steps in detail from my another answer here.

    P.S. I posted it as an answer rather than a comment because sometimes we just look for answers and ignore the comments and I believe it could be a good approach to solve this issue, so you should not ignore it and give it a read once. Thanks.

提交回复
热议问题