UIWebView get size of content and position of scroll
Categories: iPhone on Oct.29, 2009
Simple example get size of content and position of scroll for UIWebView!
1 2 3 4 5 6 | int scrollPosition = [[webView stringByEvaluatingJavaScriptFromString:@"window.pageYOffset"] intValue]; int sizePage = [[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"foo\").offsetHeight;"] intValue]; //Scroll UIWebView to point [webView stringByEvaluatingJavaScriptFromString: [NSString stringWithFormat:@"window.scrollBy(0,%d);", 100] ]; |
Similar posts:


Оставить отзыв