xcode-storyboardnsbutton

NSButton with Image and Alternate image disappears on macOS 10.13


I have a mac application with the views built in a storyboard, targeted at 10.13.

In all OS's above 10.13 all appears fine, however in 10.13 all of the buttons disappear. Buttons are Style Square, type Switch, bordered is on, transparent is on and I have both an Image and Alternate image selected.

Not sure what could be causing this and I don't have a machine running 10.13 to test on. Any ideas?

Thanks


Solution

  • Solution A: Switch off Bordered and Transparent, like the default check box in IB. A transparent button never draws itself (according to the documentation).

    Solution B: Switch on the layer of the button or one of its superviews in the View Effects Inspector. From 10.14 the button has a layer by default.

    Both solutions have the side effect that the title is also drawn, even if the image position is Image only. Remove the title as a workaround.