I have a UIWebview that loads a simple picture.The user needs to see the whole picture without the need of scrolling vertically. With the use of setSalesPageToFit:YES , The user had the image loaded but needed to scroll vertically to see the whole picture, how can i force the picture to show up entirely and no need to scrolling could be used?
This is my code snippet:
NSString *pathImg = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"1"] ofType:@"png"];
NSString* webViewContent = [NSString stringWithFormat:
@"<html>"
"<body style='background-color: transparent' >"
"<div align='center'>"
"<img src=\"file://%@\"/ style='align:center;'>"
"</div>"
"</body></html>", pathImg];
webView.backgroundColor =[UIColor clearColor];
[self->webView loadHTMLString:webViewContent baseURL:nil];
[webView setScalesPageToFit:YES];
Any help will be highly appreciated…
Try this.. Hope it will help you