I have UIWebView for displaying HTML contents. I'm getting touch coordinates from UIWebView using Longpress gesture. If i get coordinate value from UIWebView x = 146.5 and y = 230.67. I stored these value to database. Later when i load the UIWebView i'm getting these value from database. If these values match i need to go 146.5 and 230.67. While the webview i can able to go that point. But the problem is, my webview is 320x568. If i use setContentOffset: my webview size appear 146.5x230.67 instead of 320x568. I need to display webview is 320x568 but i can visit 146.5x230.67 point. Is it possbile?
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
float bx=[xv floatForKey:@"xvalue"];
float by=[yv floatForKey:@"yvalue"];
NSString *savedValue = [prefs stringForKey:@"got"];
if(savedValue){
[webView.scrollView setContentOffset:CGPointMake(bx, by)];
}
}
}
bx,by is the x and y coordinate value coming from database.
I make a test on my webview demo like this:
-(void)webViewDidFinishLoad:(UIWebView *)webView { [webView.scrollView setContentOffset:CGPointMake(0, 300)]; }
it works well.Please paste some code for deep analyze