Xcode 6 storyboard cannot center

I have a problem with the center in the storyboard object. I created a new project with one view, introduced main.Storyboard, and I'm trying to add a shortcut to the center. In previewing this storyboard for a 4-inch iPhone, the shortcut is not centered, even when I force the storyboard to use a 3.5, 4 or 4.7-inch iPhone. Adding restrictions does not matter. What am I doing wrong?

+4
source share
2 answers

If you want to center the label vertically and horizontally, you can use the Align option on the storyboard. There are four options in the bottom right corner of the storyboard, and the first is the Align option, selecting it so you can choose the alignment for your object as follows:

Alignment option

Here, in the screenshot, you can see that I chose two options if I want to focus my object in both dimensions. You can select one of them or both based on your requirements and click the Add 2 restrictions button , and it will work sequentially for any screen size. However, be sure to select the object you want to center before choosing the Align option .

+18
source

reset . . reset to suggested constraints.

+1

All Articles