UIWebview initial zoom position using UIScrollView zoomToRect?

Up vote 0 down vote favorite share g+ share fb share tw.

I have a UIWebView that is used to display an SVG image to the user. When the image has finished loading, I wish to zoom to the bottom right hand quarter of the image (so I am trying to zoom to a rectangle defined by the middle of the UIScrollView's content and half of its height and width). However, the following code seems to zoom somewhere else in the image (towards the top) and I don't know why.

In the . H file: UIWebView *webView; UIScrollView * scrollView; In the . M file: - (void)viewDidLoad { super viewDidLoad; self loadTheSVGImage; // this will load an appropriate image // scrollview will now refer to the UIScrollView within the UIWebView scrollView = webView subviews objectAtIndex:0; } - (void)webViewDidFinishLoad:(UIWebView *)theWebView { scrollView zoomToRect:CGRectMake(scrollView.contentSize.

Width / 2.0, scrollView.contentSize. Height / 2.0, scrollView.contentSize. Width / 2.0, scrollView.contentSize.

Height / 2.0) animated:YES; } webViewDidFinishLoad is called correctly. Can anyone tell me what I am doing wrong please and how I can make the zoom work as it should? Uiwebview uiscrollview svg zoom link|improve this question asked Apr 27 '11 at 10:50user2720231058 57% accept rate.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions