Re: Using table view cells from nibs
Re: Using table view cells from nibs
- Subject: Re: Using table view cells from nibs
- From: Quincey Morris <email@hidden>
- Date: Sat, 29 May 2010 09:45:12 -0700
On May 29, 2010, at 08:56, Luke Hiesterman wrote:
> I'm not sure why you're trying to separate the ideas of row and cell height. I don't think there's any reason why you should ever attempt to have a cell whose height is different from the height returned in heightForRowAtIndexPath.
Well, the specific case I was thinking of is getting vertically centered text in a NSTableView row. AFAIK there's no way to get this using standard frameworks behaviors. The only way to get text vertically centered (AFAIK) is to subclass the standard text cell and make it draw itself in a different place relative to the row height. To me, that makes row height and cell height different things.
> The table view does this for you based on the width of the table and the height the delegate returns.
Not (AFAIK) for NSTextFieldCell. The height returned by 'cellSizeForBounds:' is the height of the actual text, not the row height.
By contrast, the table view does change the cell height for button cells, and the cell's behavior is to draw its content vertically centered. This has the annoying side effect, when a row contains both a checkbox with text and a text field with text, of not lining up the text baselines, unless the row height matches the text height exactly.
If there's anything wrong with my understanding here, I'd be *very* happy to know different.
_______________________________________________
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