Navigating a Pdf using UIWebview not working in IOS 5

家住魔仙堡 提交于 2019-12-02 11:28:43

You can use UIWebView's Scrollview for navigation as Javascript is no more supported: Below is a my code worked fine for me.

    [aWebView.scrollView setContentOffset:CGPointMake(x, y)];

The contentOffset accepts a CGPoint as argument. Here x and y are integer values representing the scrollPosition. If you want to get current x and y co-ordinates for webView, below is the code which you can use:

NSInteger x = aWebview.scrollView.contentOffSet.x;
NSInteger y = aWebview.scrollView.contentOffset.y;

Note: ScrollView is introduced in IOS 5 and will not work on earlier IOS versions. Javascript function are available for earlier versions. So you can check for device version and implement code accordingly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!