Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

whitehexagon

macrumors regular
Original poster
May 12, 2007
147
0
xcode newbie!

I have a UIView that I can change the size of programmatically. Inside is a UIWebView that is pointing to a jpg (no html). Currently I only see the top left corner of the jpeg. I'm wondering if I should wrap the content into some custom html were I can set the correct size?, or if the UIWebView has some hidden magic for 'scale and fill parent view'. It needs to continue to fill when the parent UIView grows/shrinks in size.

Although I'm sure my next question with either method is controlling the aspect ratio. If I want to maintain the correct asspect ratio, then I will need someway to specify where blank space should be inserted, eg like widescreen TV black bars.

And for bonus points I'm hoping pinch/zoom will work out of the box... Although I'm finding testing pinch in simulator a pain (only seems to pinch from center of display?).

btw this is programatic, not IB!
 
update: I found:

Code:
myWebView.scalesPageToFit = YES;

which seems to help to a point. My image is 640x480 but UIWebView seems to be scaling it down to 1/4 that size. How do I control that scaling? I can't wrap the html as I originally thought becuase I'm retriving the image with basic authentication.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.