This is also what I'm looking for. I want to create a UIWebView with a frame size that will adjust itself according to the contents of the HTML string, or even more simpler an image.
Anybody have any experiences with this ? Jesse Armand ---------------------------------------- (http://jessearm.blogspot.com) On Sun, Mar 15, 2009 at 8:12 AM, William Jon Shipley <w...@delicious-monster.com> wrote: > Is it possible to set an HTML string on a UIWebView and have it resize > automatically to the right height, but NOT take up the entire screen? > > I sure can't figure it out. I feel like the iPhone really HATES rich text. > > Here's what I've tried so far. Most of these are "Hail Mary" attempts, which > I didn't expect to work: > > UIWebView *synopsisWebView = [[UIWebView alloc] > initWithFrame:(CGRect){CGPointZero, {CGRectGetWidth(self.scrollView.frame), > 30.0}}]; > synopsisWebView.autoresizingMask = UIViewAutoresizingFlexibleHeight; > // unrelated? > synopsisWebView.scalesPageToFit = YES; // just shrinks text > [synopsisWebView loadHTMLString:synopsisHTMLString baseURL:nil]; > [self.scrollView addSubview:synopsisWebView]; > [synopsisWebView layoutIfNeeded]; // no visible effect > [synopsisWebView release]; > NSLog(@"synopsisWebView frame %@", > NSStringFromCGRect(synopsisWebView.frame)); // still 30 high! > > > -W > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/mnemonic.fx%40gmail.com > > This email sent to mnemonic...@gmail.com > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com