SamBerk
SamBerk

Reputation: 531

Soft Keyboard Overlaps Input in Android WebView but Not in Chrome (DotNet MAUI App)

I'm developing a .NET MAUI app with a WebView that displays my web app. On Android, when the soft keyboard opens, it overlaps input fields instead of panning the content upward (while it does it fine on the Chrome mobile browser).

I’ve tried setting android:Application.WindowSoftInputModeAdjust="Pan" in the App.xaml file, but it doesn’t seem to have any effect on the WebView. On the other hand, using WindowSoftInputModeAdjust="Resize" works, but I specifically want the panning behavior.

How can I achieve "pan" behavior for the soft keyboard in my MAUI app's WebView on Android?

App.Xaml:

<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:MyApp.Mobile"
             xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
             android:Application.WindowSoftInputModeAdjust="Pan"
             x:Class="MyApp.Mobile.App">
    <Application.Resources>

    </Application.Resources>
</Application>

Any guidance would be appreciated!

Upvotes: 0

Views: 116

Answers (0)

Related Questions