• 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: Tables created in code have different row height from those created in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tables created in code have different row height from those created in IB


  • Subject: Re: Tables created in code have different row height from those created in IB
  • From: Aki Inoue <email@hidden>
  • Date: Tue, 21 Mar 2006 17:04:16 -0800

Hmm, this issue comes back repeatedly recently.

The default line height is affected by the typesetter behavior.

-[NSLayoutManager defaultLineHeightForFont:] would return the correct value (this case 17) by using NSTypesetterBehavior_10_2_WithCompatibility.

Aki

IB "presets" an NSTableView up by adding some columns, setting the row height, and placing it in an NSScrollView. Using the standard [[NSTableView alloc] init] will not do any of this, and the programmer must set it up the way they want, including setting the font. The row height set by IB is not dynamic; once set to 17, it will stay at 17. NSTableView's initial rowHeight will always be 16; it won't dynamically change based on system settings; doing so would be bad for programmers who assume it to be a certain size.

Using defaultLineHeightForFont+1 will make your tableview dynamically change its size, which is good! But, it isn't something I want to have NSTableView do by default.

Thanks,

--corbin


On Mar 21, 2006, at 10:42 AM, Peter Boctor wrote:

That looked promising. But unfortunately NSLayoutManager's
defaultLineHeightForFont also returns 16 for the standard system font.


So instead of hardcoding 17, now I'm hardcoding defaultLineHeightForFont+1.

I've filed <rdar://problem/4485554>

-peter

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Tables created in code have different row height from those created in IB (From: "Peter Boctor" <email@hidden>)
 >Re: Tables created in code have different row height from those created in IB (From: Greg Herlihy <email@hidden>)
 >Re: Tables created in code have different row height from those created in IB (From: "Peter Boctor" <email@hidden>)
 >Re: Tables created in code have different row height from those created in IB (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: Crash in NSOpenPanel
  • Next by Date: NSPopupButtonCell in table view - size problem
  • Previous by thread: Re: Tables created in code have different row height from those created in IB
  • Next by thread: Re: Tables created in code have different row height from those created in IB
  • Index(es):
    • Date
    • Thread