iphone - UIWebView's property scalesPageToFit = YES not working correctly on larger images -
in iphone app have webview in want preview image downloaded internet, problem images not viewed fit in frame of webview, do. think due fact images large. doing wrong? please help
what want loading image in webview fit frame of webview. can provide me other code, need regarding webview not imageview.
here code using.
self.documentdata = [nsdata datawithcontentsofurl:[nsurl urlwithstring:@"http://www.folio3.com/corp/wp-content/uploads/2013/02/entrance_a-3.jpg"]]; self.webview.scalespagetofit = yes; [self.webview loaddata:self.documentdata mimetype:@"image/jpeg" textencodingname:@"utf-8" baseurl:nil]; plus here screenshot of output (clearly shows scroll indicators i-e image not fit in webview's frame)
try using html content webview, following code
<html> <head> <title>title</title> </head> <body style='margin:0px; padding:0px;'> <img src='<your_image_url>' style='max-width:320px; max-height:460px;' alt='your_image_name'/> </body> </html> to re-size image use css (cascaded style sheet) styling, play these style properties in image style attribute
max-width, min-width, width, max-height, min-height & height
Comments
Post a Comment