setCornerRadius: causes flickering in NSTableView

313 views Asked by At

I'm using a view based NSTableView which displays a NSTableRowView containing an NSImageView and some NSTextFields. The NSTextFields are having the backgroundColor property set and are drawing correctly. I've tried to draw them with rounded corners by setting

[textfield.layer setWantsLayer: YES];
[textfield.layer setCornerRadius: 5.];

What is working but causes the views with the applied corner radius to flicker while scrolling the table view. Setting the view's layer via textfield.layer [setLayer: [CALayer layer]] or forcing the layer to rasterize by setting [textfield.layer setShouldRasterize: YES] also did not work. Any suggestions how to get rid of the nasty flickering? I'm developing on Mavericks for Mavericks using Xcode 5.

1

There are 1 answers

1
Quxflux On BEST ANSWER

With the help of uchuugaka's post I was able to fix it using this tutorial: Tutorial