views:

1520

answers:

2

Hi

I have a UIWebView And how can i get It's scroll position ?

I know, that UIWebView has a UIScroller subview. But I can't get offset of this UIScroller (((

A: 

I don't think there is an official way. You may have to iterate through it's subviews until you find an object of the type UIScrollView.

Squeegy
It has not UIScrollView subviewIt has only undocumented UIScroller subview ((
oxigen
+7  A: 

This trick works for me.

UIWebView *webView;
int scrollPosition = [[webView stringByEvaluatingJavaScriptFromString:@"window.pageYOffset"] intValue];
Chris Lundie
Thanks. Super. It's worksMay be you know, how can I get WebView content size, with javaScript? (window.innerHeight doesn't work)
oxigen