In the Notes-application image above you see that the first root item is not shown in a header cell. You just see a child with All Notes, how can this be accomplished?
Asked
Active
Viewed 152 times
1 Answers
0
I know that with UICollectionView you would generally set setHeaderReferenceSize=CGSizeZero
within a layout delegate method or via subclassing the layout class UICollectionViewFlowLayout and setting the setHeaderReferenceSize property there. I suggest looking at the class documentation for NSOutlineView and locate the property which determines the size of the header and adjust accordingly.

Robert Hartshorn
- 176
- 10
-
They have a 'optional func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat' however it says in the documentation Values returned by this method should not include intercell spacing and must be greater than 0. So that won't help me. – Mark Aug 23 '17 at 07:35
-
Darn. So, NSOutlineView inherits from NSTableView. It sounds like another poor soul has been here before in trying to suppress a header for a single section (in this case, also the first section). It's ObjC solution, but I'm hoping it might help conceptually or contextually. https://stackoverflow.com/questions/19056428/how-to-hide-first-section-header-in-uitableview-grouped-style – Robert Hartshorn Aug 23 '17 at 12:38
-
1They are hiding the extra pixels lol :) I could give the NSOutlineView a margin offset of -2 pixels. You would think that if Apple would use it in their applications it would be something more sufisticated. – Mark Aug 23 '17 at 14:22
-
Whattttttt? Hahaha. That is so hacky of them! Reminds me vaguely of a bug in UICollectionView where we had to set `setReferenceSizeForHeader` to .00001 in order to still show a section when the section had no items. – Robert Hartshorn Aug 23 '17 at 14:28