79285114

Date: 2024-12-16 15:05:37
Score: 0.5
Natty:
Report link

post my answer for who's searching about ionic keyboard trigger resize webview...

Descrition:

Ionic Android will auto resizing webview while focusing input.

My need is prevent this default behavior 👇🏻

enter image description here

Steps:

  1. Add config options in ~/capacitor.config.ts:
CapacitorConfig = {
  ...
  plugins: {
    Keyboard: {
    
      //OptionA:
      resizeOnFullScreen: false,
      
      //or
      
      //OptionB:
      //resize: "none",
      
    },
  }
}
# then run command below
# to copy config options to Android project at `/MyIonicApp/android/app/src/main/assets/capacitor.config.json`

  ionic capacitor sync android
  1. Then set MainActivity configs in ~/android/app/src/main/AndroidManifest.xml:
<activity ... android:windowSoftInputMode="adjustPan" ...>
  1. run Android app...

Refs:

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Corxit Sun