Search code examples
macosnibnsbutton

Button not showing in .nib file


So I downloaded CircleView and tried to change the code. The program came with a button, color wheel, 2 sliders, and a view. When ever I add anything (Slider, button, textfield), on run time the things I added wouldn't show up. What am I not doing?

It's a .nib file.

enter image description here

This is the edit page.

This is what I see when running the program.

enter image description here

As you can see, the button and textfield doesn't appear during run time.


Solution

  • By default, when you add a button, the autoresizing mask (aka "springs and struts") are set to the following:

    enter image description here

    That means that when you resize the window, the button you added will stay in the same spot it originally was, instead of being "pulled" down with the edge of the window. This could potentially cause the buttons or textfields you added to be hidden behind the circle view once you resize the window large enough.

    To prevent that from happening you'll want to change the autoresizing mask of the items to be "pinned" to the bottom edge of the window, so that they look like in the following image:

    enter image description here

    To do that, click on the red I bar at the top of the square to remove it, and then click on the lower I area to turn it on.

    Note that you can also select multiple buttons or textfields at one time to change them all at the same time.