Android How to adjust layout in Full Screen Mode when softkeyboard is visible

前端 未结 25 2155
后悔当初
后悔当初 2020-11-22 03:56

I have researched a lot to adjust the layout when softkeyboard is active and I have successfully implemented it but the problem comes when I use android:theme=\"@andro

25条回答
  •  无人共我
    2020-11-22 04:43

    I was only using full screen mode to hide the status bar. However, I want the app to resize when keyboard is shown. All of the other solutions (likely due to age of post) were complicated or not possible for my use (want to avoid change Java code for sack of PhoneGap Build).

    Instead of using Full screen, I modified my configure for Android to be non-fullscreen:

                
    

    And added the cordova-plugin-statusbar, via command line:

    cordova plugin add cordova-plugin-statusbar
    

    When app has loaded, I simple call a method on the plugin to hide itself, like:

        if (window.cordova && window.cordova.platformId == 'android' && window.StatusBar)
            window.StatusBar.hide();
    

    This works like a charm. Only real downside is that the status bar is breifly visible while the app loads. For my needs, that wasn't an issue.

提交回复
热议问题