sindresorhus / Settings

⚙ Add a settings window to your macOS app in minutes
MIT License
1.43k stars 100 forks source link

Preferences Window has zero height #31

Closed kevinrpb closed 5 years ago

kevinrpb commented 5 years ago

Hi there,

So I was trying out this project because it looks great, but I'm having some trouble. First I tried the published version (0.2.1) in Cocoapods and it worked fine. However it doesn't include some of the recent changes such as using the segmented control. So I decided to use the version in master instead.

Now with this I am having trouble. I simply created a new project and did what was explained in the README (this project can be found here), and the preference window is not showing. It gets created and I can focus it, but it's not visible. I looked at the frame of the window, and it shows that the window has a height of 0 pixels... But I am not sure why that is happening...

I would really appreciate some help here 🙏

Thank you, Kevin

DivineDominion commented 5 years ago

Please have a look at your content view: if you use Auto Layout, the view will most likely have an intrinsicContentSize that pushes the window frame outward, so to speak. But if you don't use Auto Layout, you may have to provide a content size yourself. See #28

kevinrpb commented 5 years ago

I had missed that PR. Seems like setting self.preferredContentSize did the trick there. Thank you very much!