• 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: UITableView with cells of varying heights
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone: UITableView with cells of varying heights


  • Subject: Re: iPhone: UITableView with cells of varying heights
  • From: Luke the Hiesterman <email@hidden>
  • Date: Thu, 14 Jan 2010 06:56:01 -0800

Calculate label height with [NSString sizeWithFont:ForWidth:LineBreakMode:]. sizeWithFont:forWidth:lineBreakMode:

Assign cell row heights with [UITableViewDelegate tableView:heightForRowAtIndexPath:] – tableView:heightForRowAtIndexPath:

Luke

On Jan 14, 2010, at 6:46 AM, Eric E. Dolecki wrote:

> I am pulling in an RSS feed, and each item has it's own summary of a varying
> amount of text. I am using a table and presently setting the height of each
> row the same to allow for the most text. This looks awful as some items have
> a lot of empty space for it's row.
>
> Is it possible to have a UILabel where I set numberOfLines = 0, set the
> width, and have the height of the label expand vertically to contain all of
> the text, and then use it's height to help determine the height the cell
> itself needs to be? The result would be a UITableView with rows of varying
> heights, perfectly framing each row's content.
>
> I was using a UIWebView to display the summary since it came with tons of
> html tags in it, but I've since just stripped all of the tags out of each
> item's summary.
>
> Thanks,
> Eric
> _______________________________________________
>
> 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: UITableView with cells of varying heights
      • From: Luke the Hiesterman <email@hidden>
References: 
 >iPhone: UITableView with cells of varying heights (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: iPhone: UITableView with cells of varying heights
  • Next by Date: Re: iPhone: UITableView with cells of varying heights
  • Previous by thread: iPhone: UITableView with cells of varying heights
  • Next by thread: Re: iPhone: UITableView with cells of varying heights
  • Index(es):
    • Date
    • Thread