How to fix bug of iOS of KeyboardOverlapRenderer

Westview Investment 0 Reputation points
2023-06-08T00:23:06.7433333+00:00

AppDelegate.cs

KeyboardOverlapRenderer.Init();

After opening the website with webview function, when inputting with the text keyboard, it is difficult to enter the content as it rises above the content.

AppDelegate.cs:
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
       global::Xamarin.Forms.Forms.Init();
       LoadApplication(new App());
       KeyboardOverlapRenderer.Init(); // Initializing KeyboardOverlapRenderer
       return base.FinishedLaunching(app, options);
}


HomePage.xaml.cs:

Xamarin.Forms.WebView Browser { get; set; }
public HomePage()
{
	InitializeComponent();
	Url_info = "https://example.com";
	
	Browser = new Xamarin.Forms.WebView
	{
		Source = new UrlWebViewSource
	        {
        	   Url = Url_info,
	        },
        	VerticalOptions = LayoutOptions.FillAndExpand
	};
            
	this.Content = new StackLayout
	{
		Children =
	        {
        		Browser,
	         }
	};
}

When the keyboard pops up, it is just pushing contents away from it instead of overlapping it. Also, it pushes too far up that I can't locate the input fields. To answer your question ["Can you make the webview page scroll to the bottom again after the keyboard pops up?"], I can scroll it back to the bottom again, but can't scroll back up. Here are some screenshots of what is happening in my app.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
{count} votes