Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove border from NSScrollView/NSCollectionView

As you can see in the screenshot below, the NSCollectionView I used has some kind of border (the thin gray lines) I want to get rid of. Can somebody tell me how to achieve this? I already tried subclassing the NSCollectionView and tried to overwrite it in the drawRect: by using [[super layer] setBorderWidth:0.0f]; but this did not work.

enter image description here

Searching on Google, SO and the Apple Documentation did not help either. So did anyone achieved this already or knows where I can find an example of how to do it?

Thanks in advance, Björn

like image 263
Björn Kaiser Avatar asked Aug 27 '12 15:08

Björn Kaiser


1 Answers

The collectionView is nested in a NSScrollView, which has a borderType property. You can get rid of the border by simply setting its border type to NSNoBorder.

self.collectionView.enclosingScrollView.borderType = NSNoBorder;
like image 60
chrs Avatar answered Sep 28 '22 08:09

chrs