ios - WkWebview contentOffset not working when settign animated false -
i need set contentoffset of wkwebview contents finished load. set webview.scrollview.setcontentoffset(offset, animated: true)
inside webview didfinish navigation.
if set animated true
, works when set false
, webview not scroll.
how can scroll webview without animating?
- (void)webviewdidfinishload:(uiwebview *)webview { [webview.scrollview scrollrecttovisible:cgrectmake(0.0f, 0.0f, 0.0f, 0.0f) animated:no]; }
or can use javascript
nsstring *script = @"scrollto(0, 0)"; [webview stringbyevaluatingjavascriptfromstring:script];
Comments
Post a Comment