Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] WebView ContentHeight (IOS) #15073

Open
pawelt94 opened this issue Jan 19, 2022 · 1 comment
Open

[Bug] WebView ContentHeight (IOS) #15073

pawelt94 opened this issue Jan 19, 2022 · 1 comment
Labels
a/webview p/iOS 🍎 s/unverified New report that has yet to be verified t/bug 🐛

Comments

@pawelt94
Copy link

Description

I want to get the height of content in webview. On android, the height value is correct. On iOS, the value is too high. I think the width on iOS is incorrect (93) - possible reason.

I created a clean project in xcode. Value of contentHeight is correct.

Swift code:

   func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
            let Height = self.webview.scrollView.contentSize.height
            self.containerHeight.constant = Height
        }
    }

###Steps to Reproduce
Xamarin project repo: https://github.com/pawelt94/WebViewContentHeight

Expected Behavior

Zrzut ekranu 2022-01-19 o 11 59 07
Xcode project:
Zrzut ekranu 2022-01-19 o 12 18 26

Actual Behavior

Zrzut ekranu 2022-01-19 o 11 59 23

Environment

Xamarin Forms 5.0.0.2291

Reproduction Link

Xamarin project repo: https://github.com/pawelt94/WebViewContentHeight

@pawelt94 pawelt94 added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 19, 2022
@pawelt94
Copy link
Author

This may be a related problem. When on Android a web view is hidden by default and then I change the IsVisible value to true, the content height is bad. If IsVisible = true by default, you're fine.
Zrzut ekranu 2022-01-25 o 11 15 36

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/webview p/iOS 🍎 s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants