PhoneGap Page scroll up after Keyboard appearance in iOS devices that makes the PhoneGap page corrupted

后端 未结 6 1387
刺人心
刺人心 2020-12-17 02:10

I am trying to develop a chatting application using PhoneGap for iOS devices. The application has a header that shows the logged user, a footer where user can write his text

相关标签:
6条回答
  • 2020-12-17 02:25

    I fixed it using css and a wrapper

    /*Phone < 5:*/
     @media screen and (device-aspect-ratio: 2/3) {
      .content {
       height: 416px !important;
     }
    }
    
     /*iPhone 5:*/
    @media screen and (device-aspect-ratio: 40/71) {
      .content {
        height: 504px !important;
      }
    }
    
    0 讨论(0)
  • 2020-12-17 02:33

    I was having the same issue using twitter bootstrap 3.

    Adding:

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    

    Solved the problem for me.

    0 讨论(0)
  • 2020-12-17 02:36

    Screen Height changes when keyboard pops up

    The cordova/phonegap application screen height or window.innerHeight value is getting reduced when the keyboard pops up, this re-sizes the contents inside & makes your screen look corrupted.

    Using Javascript, On deviceready or Application initialize set the device screen height to your wrapper/container element.

     $('#container').height(window.innerHeight);  // jQuery 
    
    0 讨论(0)
  • 2020-12-17 02:42

    I have contacted PhoneGap Support and they informed that a proper fix is expected to be done in PhoneGap 2.6 release concerning this issue

    0 讨论(0)
  • 2020-12-17 02:43

    In order to fix this Issue temporarily (because it shows breaks while keyboard is showing), you can set "KeyboardShrinksView" to "true" in your configuration file (config.xml) or add it:

    <widget>
      ...
      <preference name="KeyboardShrinksView" value="true" />
    
      <plugins>...
    
    0 讨论(0)
  • 2020-12-17 02:51

    For now you can add a:

    document.body.scrollTop = 0;
    

    whenever the input field recieves a blur event.

    0 讨论(0)
提交回复
热议问题