Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 200
JacobF Avatar asked Jan 08 '15 09:01

JacobF


People also ask

What is ion-content?

ion-contentThe Content component provides an easy to use content area with some useful methods to control the scrollable area. There should only be one content in a single view component. If additional scrollable elements are need, use ionScroll.

How do I disable scrolling in ionic?

Content Scrolling Disable Enable IONIC Framework - We can disable/enable scrollbar pragmatically. There are some some example are give, you your suitable. Example 1 - Try a setting <content scroll="false"> that will disable scrolling. This every time an event is called, in our case, on every drag event.

How do I scroll to top in ionic?

First step is to achieve the go to top button or scroll to top or bottom button is the scroll-events property of ion-content. This property allows ion-content to listen the scroll events like scroll-start, scroll-end and apply scroll methods to scroll the page to the particular position of the page.


2 Answers

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);

  }
like image 193
Nizar B. Avatar answered Sep 21 '22 01:09

Nizar B.


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

like image 40
Mithlesh Kumar Avatar answered Sep 19 '22 01:09

Mithlesh Kumar