Re: iPhone UIWebView height?
Re: iPhone UIWebView height?
- Subject: Re: iPhone UIWebView height?
- From: Jesse Armand <email@hidden>
- Date: Sun, 15 Mar 2009 13:30:16 +0800
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
<email@hidden> 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 (email@hidden)
>
> 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:
>
> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden