Calculate height of a webview in advance?
I have several w开发者_StackOverflow社区ebviews that will be displaying text with html tags. I want to be able to calculate what the height of the webview would be if it wrapped the contents so that I can animate the height to that point myself. Given an html string, how can I calculate the height it will take up in a webview of a given width?
You can use the PictureListener hook to get the size and run your animation the instant the page is finished loading. It will happen fast enough that it is like knowing in advance.
精彩评论