Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 to achieve. I have a scrollview that contains my page content and a linearlayout that is aligned to the parent bottom that acts as a nav bar.

Example of what i want it to do

Problem is that when the keyboard popups, it pushes my entire view up, including the bottom nav section. I do not want to disable the automatic pushing up of the view (by setting android:windowSoftInputMode="adjustPan") but rather exclude a single element from being pushed up, my bottom nav bar.

I have tested the windowSoftInputMode fix but it hides my page content behind the keyboard. Is there a way to have it continue pushing up the scrollview but not the bottom nav? My other option was to set visibility:gone on keyboard up and then reshow it on keyboard down, but that seems overly complicated and not always reliable from what i read.

If anyone has any examples or suggestions, i'm all ears. Thanks.

like image 723
Thomas Stein Avatar asked Jul 14 '16 23:07

Thomas Stein


People also ask

How do I make my navigation bar stay at the bottom?

To set the navigation bar at bottom, use position: fixed property, with bottom property.

How do you turn off the behavior bottom navigation bar goes up with keyboard in flutter?

I just came across the same problem where my bottomNavbar is moving up with the keyboard when the keyboard is enabled. I solved it by checking if the keyboard is open or not. If it is open, just hide the disable the bottomNavbar and when it is closed, it's time to enable the navbar..

How do you move the layout up when the soft keyboard is shown Android fragment?

Set fitsSystemWindows = "false" and set android:windowSoftInputMode="adjustResize" in manifest file. Show activity on this post. I have used like this to show the soft keyboard programatically and this is worked for me to prevent the auto resize of the screen while launching the keyboard.


1 Answers

Either add this as scrollbar's XML attribute

android:isScrollContainer="false"

or add this in Activity's tag in Manifest

android:windowSoftInputMode="adjustPan"

like image 87
JiratPasuksmit Avatar answered Sep 21 '22 16:09

JiratPasuksmit