开发者

Uiwebview refreshes after zoom and pinch

I have a uiwebview in my App. So far everything works fine开发者_开发问答, but when i zoom in or out for example the uiwebview refreshes the loaded page and then scrolls and zooms to the new page location and size. So the zooming works good, but I don't want the user to see the refresh and repositioning of the website.

Is there a way to prevent this?

Thanks for any tips!


This could be because you might have coded your zoom in an odd way. You could try deleting all your zoom code, and in the same method where you have your webView loadRequest, type:

self.webView.scalesPageToFit = YES

Hope this helps.


You should refresh your page dynamically, instead of refreshing it through the webview. You can accomplish this by using AJAX or retrieving the content in Objective C and injecting it using stringByEvaluatingJavaScriptFromString:.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜