Search code examples
macoscocoaxcode9xcode-storyboard

View is clipping its content - NSPopUpButton only


enter image description hereIn Xcode 9, an NSPopUpButton is now issuing a warning about 'View is clipping its content'.

PopUp button screenshot

The only satisfying settings seems to be to stretch it horizontally through the view (right and left fixed constraints).

This issue is from a clean project with just this popup button added to the Storyboard. In other words, can be recreated easily.
The constraints are top-left simple fixed to superview with the added (since Xcode 9) right 'greater or equal' to superview with constant as 'standard'.
Also, the warning is not a 'yellow' warning. It only shows when opening the 'Issue Navigator' (⌘5). I'm assuming of course, that popup buttons are not required to grab the whole view length now.


Solution

  • You just need to increase your control size because its contents (NSMenu items which belong to it) are too big to fit inside the NSPopUpButton control. Your case when you stretched the control to the end of the window satisfied that condition and your control became big enough to contain its contents.