• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iPhone UIWebView height?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: iPhone UIWebView height?
      • From: glenn andreas <email@hidden>
References: 
 >iPhone UIWebView height? (From: William Jon Shipley <email@hidden>)

  • Prev by Date: Re: How to create an NSDecimal?
  • Next by Date: [Q] inconsistent naming for Core Graphics and Foundation?
  • Previous by thread: iPhone UIWebView height?
  • Next by thread: Re: iPhone UIWebView height?
  • Index(es):
    • Date
    • Thread