• 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: Computing the height for a UITableViewHeaderFooterView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Computing the height for a UITableViewHeaderFooterView


  • Subject: Re: Computing the height for a UITableViewHeaderFooterView
  • From: Rick Mann <email@hidden>
  • Date: Tue, 06 Aug 2013 00:23:15 -0700

Unfortunately, that won't compute the height of the UITableViewHeaderFooterView, which has two different labels with different text characteristics, and who know what positioning within.

On Aug 5, 2013, at 18:57 , synelang <email@hidden> wrote:

> Try this : (never tested)
>
> 	• void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section_
> {
> 	CGSize size = [dataString sizeWithFont:font constrainedToSize:size lineBreakMode:UILineBreakModeWordWrap];
> 	CGFrame frame = view.frame;
> 	frame.size.height = size.height;
> 	• 	[view setFrame:frame];
> 	• }
>
>
>
>                              Original Message
> Sender: Rick Mann<email@hidden>
> Recipient: Cocoa Dev List<email@hidden>
> Date: 星期二, 8月 6, 2013 09:25
> Subject: Computing the height for a UITableViewHeaderFooterView
>
> Is there any way around manually providing the height for a table header view? If I simply provide a title string for the header, UITableView is able to compute the height itself. But if I use a UITableViewHeaderFooterView and set the textLabel and detailTextLabel, I also have to set the height (as far as I can tell).
>
> But the text I'm rendering is dynamic, and could change the number of lines used. Not sure how best to handle this.
>
> --
> Rick
>
>
>
>
> _______________________________________________
>
> 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


--
Rick




_______________________________________________

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: Computing the height for a UITableViewHeaderFooterView
      • From: Diederik Meijer | Ten Horses <email@hidden>
  • Prev by Date: Computing the height for a UITableViewHeaderFooterView
  • Next by Date: Re: Computing the height for a UITableViewHeaderFooterView
  • Previous by thread: Computing the height for a UITableViewHeaderFooterView
  • Next by thread: Re: Computing the height for a UITableViewHeaderFooterView
  • Index(es):
    • Date
    • Thread