Are there any techniques to cause a UIWebView to redraw itself? I've tried setNeedsDisplay
and setNeedsLayout
on the UIWebView and its UIScrollView, but neither have worked.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
This save my life:
Add this line on webview did load delegate event or wkwebview did finish navigation
Thanks MAN!!!!
Literally found the answer right after asking. The key was to tell the subviews of
UIWebView
'sscrollView
to redraw themselves - particularly theUIWebBrowserView
.I've commented out the if statement to be safe and avoid reliance on
UIWebBrowserView
's class name not changing. Without it, it hits all UIViews that are in the scrollview, which isn't really a problem at this point (no significant overhead incurred) but could always change.EDIT:
In some cases, the following snippet of JavaScript will accomplish the same/similar thing:
You'd think
UIScrollView
'scontentOffset
would do this too, but that's not always the case in my experience - for some reasonwindow.scrollTo
is special in this regard.Gist: https://gist.github.com/matt-curtis/5843862