Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get heigth when add downview to other view? #67

Closed
0xIce opened this issue Jan 18, 2018 · 5 comments
Closed

get heigth when add downview to other view? #67

0xIce opened this issue Jan 18, 2018 · 5 comments

Comments

@0xIce
Copy link

0xIce commented Jan 18, 2018

i tried to get height in WKWebview's delegate: didFinish Navigation, but get the wrong height, much heigher than correct.
How can i get then corret DownView height?

@128keaton
Copy link
Collaborator

You might want to get the content size instead, since the WKWebView's height is the size of the actual view--the content size should extend beyond that. Read: https://stackoverflow.com/questions/16910117/how-to-find-the-height-of-content-of-scroll-view-or-webview-in-iphone

@0xIce
Copy link
Author

0xIce commented Jan 21, 2018

i tried two methods to get height, all fialed.

  1. js: document.body.offsetHeight (didFinish Navigation delegate)
  2. webView.scrollView.contentSize.height

@iwasrobbed
Copy link
Collaborator

@Hotchner Can you please explain what you're trying to do with the height?

There are different heights, so it's difficult to point you in the right direction unless we understand your use case.

@0xIce
Copy link
Author

0xIce commented Jan 22, 2018

@iwasrobbed I add downView to a tableViewCell, and i need to update tableView height when downView complete render. So i calculated the height in webView's delegate, didFinish Navigation.

@iwasrobbed
Copy link
Collaborator

You're better off asking that on StackOverflow (e.g. https://stackoverflow.com/questions/27515236/how-to-determine-the-content-size-of-a-wkwebview?noredirect=1&lq=1).

DownView is nothing more than a basic WKWebView subclass so we'd rather avoid general programming questions unless it's specifically related to the Down lib and reproducible for us to debug.

Repository owner locked as off-topic and limited conversation to collaborators Jan 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants