• 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: Greg Herlihy <email@hidden>
  • Date: Tue, 21 Mar 2006 18:48:07 -0800
  • Thread-topic: Tables created in code have different row height from those created in IB

Actually, Interface Builder does adjust the height of an NSTableView's rows
to match the table's font. For example selecting a table, choosing
Format->Font->Smaller changes both the table's font size (from 13 to 12) and
reduces the height of its rows (from 17 to 16).

Greg


On 3/21/06 4:42 PM, "Corbin Dunn" <email@hidden> wrote:

> 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

  • Follow-Ups:
    • Re: Tables created in code have different row height from those created in IB
      • From: Corbin Dunn <email@hidden>
References: 
 >Re: Tables created in code have different row height from those created in IB (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: NSTreeController selection/selectionIndexPath
  • Next by Date: -[NSString localizedCompare:] - example of semantic difference with compare?
  • 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