In my MAUI project, I want to set the WindowSoftInputModeAdjust to Resize on a specific page and WindowSoftInputModeAdjust to Pan on other pages since it affects my other pages UI like below.
I tried using the code below, but it didn't work.
I added the below code on the cs page where I need the resize option:
protected override void OnAppearing()
{
try
{
base.OnAppearing();
App.Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
}
catch (Exception e)
{
Debug.WriteLine("Exception:>>" + e);
}
}
protected override void OnDisappearing()
{
try
{
base.OnDisappearing();
App.Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Pan);
}
catch (Exception e)
{
Debug.WriteLine("Exception:>>" + e);
}
}
I added the below code on the cs page where I need the pan option:
protected override void OnAppearing()
{
try
{
base.OnAppearing();
App.Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Pan);
}
catch (Exception e)
{
Debug.WriteLine("Exception:>>" + e);
}
}
I set the WindowSoftInputModeAdjust to Pan on MainActivity.cs. Please provide a solution for this?
Update
The UI issue is happening on the home page only after the comment page keyboard open after the editor tap. If I view the comment page and without opening keyboard, no UI issue in home page. When keyboard is opening that page is resizing and as a result home page is also resizing.
Here is the full explanation video.
If I am not using resize option on the inner page, the header part is not visible on the UI like below screenshot:
That issue video.


First of all, there is an known issue: [regression/8.0.0] [Android] WindowSoftInputModeAdjust not working anymore. You can follow up it.
And then, you can use the android native platform code to set the WindowSoftInputModeAdjust.
In addition, you can use the
Platform.CurrentActivity?.Window?.Attributes?.SoftInputModeto get the current SoftInputMode.