Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

iOS SafeArea + WKWebview

$
0
0

Hello,

I have a WKWebview in a window without SafeArea because I want the content to be seen until the end of the screen.

To do this, I have created a CustomWebview by overriding the safeAreaInserts:

        public class CustomWKWebView : WKWebView {

        static UIEdgeInsets _safeAreaInserts = new UIEdgeInsets(0, 0, 0, 0);


        public CustomWKWebView(IntPtr handle) : base(handle) { }
        public CustomWKWebView(NSCoder coder) : base(coder) { }
        public CustomWKWebView(NSObjectFlag t) : base(t) { }
        public CustomWKWebView(CGRect frame, WKWebViewConfiguration configuration) : base(frame, configuration) { }

        public override UIEdgeInsets SafeAreaInsets => _safeAreaInserts;

        }

Yes, it works but ..

. I need something more: The device notch hides webview content.

I ned that side of webview that is under the notch keeps the "Margin" so that the content is not below the notch.

That is to say: I want webview cover the entire screen except under the notch.

Some ideas?


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>