views:

747

answers:

1

Hi all,

I have a UIWebView and UIButton added as subview to my View. And I have a large webpage displayed inside my UIWebView, is it possible to scroll the webpage by clicking a button on the UIView?

I want to make the webpage scroll untill it reaches the bottom of the document.

The javascript to be used is : window.scrollTo(xPos, yPos);

Is it possible to make a javascript call on the button action which will scroll the web document inside the UIWebView ? Or is there any other way ??

Thanks ...

+1  A: 

You can use that on you UIWebview component:

NSString *yourScript = [NSString stringWithFormat:@"javascript_method();"]; NSString* responseJS = [webView stringByEvaluatingJavaScriptFromString:yourScript];

Al.

Ali