Sunday, 8 September 2013

iOS UIWebView force image size objective c Xcode

iOS UIWebView force image size objective c Xcode

I have an incoming HTML that contains img tags.
I need to force the images to be max the size of the viewport: iPhone or
iPad. Currently the text fits the screen nicely, but the images overflow
the screen size. I can force to [_wvContent setScalesPageToFit:YES];, but
then the text is too small.
Any way to make the images the screen size?
Couple of incoming examples:
<img alt="Comparison "
src="http://www.sample.com/wp-content/uploads/wp-post-thumbnail/dsa_k4iI.jpg"
class="wppt_float_left" title="Comparison Photo" />
<img class="alignnone size-full wp-image-107864" alt="320d Comparison "
src="http://www.sample.com/wp-content/uploads/590px4_2526_RT.jpg"
width="590" height="329" title="20d Comparison" />
<img alt=""
src="http://www.sample.com/wp-content/uploads/wp-post-thumbnail/dsa_ka.jpg"
class="wppt_float_left" title="2013 BMW 320i: Track Tested by Edmunds
Photo" />
<img class="alignnone size-medium wp-image-107859" alt=""
src="http://www.sample.com/wp-content/uploads/201_-655x436.jpg"
width="655" height="436" title="" />
Thanks for your help.

No comments:

Post a Comment