SoftInput.AdjustPan doesn't work

326 Views Asked by At

Hello to all programmers. I try to create Android app in Visual Studio Xamarin. I placed EditText in the lower part of app screen and when I set focus on it, keyboard hide bottom part of UI. Is it possible to do something with this?

Screens: Keyboard hide

Code: Main.axml MainActivity.cs

All help will be appreciated

UPDATED

Theme code:

<resources>
  <style name="CustomToolbar" parent="@android:style/Theme.Material.Light">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:colorPrimaryDark">@color/status_bar</item>
    <item name="android:statusBarColor">@color/status_bar</item>
    <item name="android:colorPrimary">@color/status_bar</item>
  </style>
  <style name="TransparentStatusBar" parent="@android:style/Theme.Material.Light.DarkActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
  </style>
  <style name="CustomSplash" parent ="@android:style/Theme.Material.Light">
    <item name="android:windowBackground">@drawable/splash_screen</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
  </style>
</resources>
1

There are 1 best solutions below

3
On

You can put your layout inside ScrollView. I will allow EditText to be fully visible, but it will not do anything with bottom buttons since they do not block that field.

If you want to make it more pressure for eyes, you can scroll ScrollView when the keyboard is presented on the screen.

EDIT: To find out when the keyboard appears, you can use GlobalLayout event of the main layout.

ViewTreeObserver vto = element.ViewTreeObserver;       
vto.GlobalLayout += (sender, args) => {      
        element.Height; // will be different with/without keyboard 
};