Android soft keyboard hides inputs from CordovaWebView when in fullscreen

前端 未结 3 359
春和景丽
春和景丽 2020-12-31 18:41

I have a CordovaWebView that presents some html forms. When i focus on an input field, the Android\'s soft keyboard pops up and, for certain fields, according to their posit

3条回答
  •  借酒劲吻你
    2020-12-31 19:22

    Remove android:theme="@android:style/Theme.NoTitleBar.Fullscreen" from manifest, and add these 2 lines of code:

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    

    Make sure your onCreate method looks like this:

    @Override
        protected void onCreate(Bundle savedInstanceState) {
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            getWindow().addFlags(LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    
            super.onCreate(savedInstanceState);
            setContentView(R.layout.yourLayout);
    
            // Your code ...
    }
    

    And everything will work :D.

提交回复
热议问题