Ionic ion-content not scrolling down when keyboard shows (Android)

15,007

Solution 1

In the section where you declare the keyboard plugin, try to add this:

  if (window.cordova && window.cordova.plugins.Keyboard) {
    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    cordova.plugins.Keyboard.disableScroll(false);

  }

Solution 2

I have prevent this scrolling property in my project by setting below values in AndroidManifest.xml file.

android:windowSoftInputMode = "adjustNothing"

Please check whether android:windowSoftInputMode value is adjustResize or not in AndroidManifest.xml. If not please update it to adjustResize.

I hope this will you. Thanks

Solution 3

On both Android and iOS, Ionic will attempt to prevent the keyboard from obscuring inputs and focusable elements when it appears by scrolling them into view. In order for this to work, any focusable elements must be within a Scroll View or a directive such as Content that has a Scroll View.

description from documentation here

Share:
15,007
JacobF
Author by

JacobF

Updated on July 26, 2022

Comments

  • JacobF
    JacobF almost 2 years

    I have a simple view with a login form. On Android, if the keyboard is opened, the content is not scrolling up to prevent it from getting behind the keyboard.

    I followed the Keyboard instructions from the docs, and read a lot of forum posts, but I haven't figured it out.

    I installed the Keyboard plugin com.ionic.keyboard.

    This is the structure of the page:

    <ion-nav-view>
      <ion-view>
        <ion-content>
           ...<form>..Login form..</form>...
        </ion-content>
      </ion-view>
    </ion-nav-view>
    

    If I put some extra dummy content in the page, it shows that ion-content is indeed scrollable. However, it's not moving up when the keyboard is opened by focusing on an input.

    • Ionic version? 1.0.0-beta.13
    • Is my app fullscreen? No
    • Did I test if the keyboard plugin is working? Yes

    Is there anything else I have to do?