Adjust Center of Measure in Xcode 6

前端 未结 5 827
后悔当初
后悔当初 2021-01-21 21:23

In the new \"Xcode 6\" the ability to change the center of measure of a button is missing.

In Xcode 5: http://imgur.com/jWHJp4v

Xcode 6: http://imgur.com/rsNayVZ

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 21:43

    If your layout isn't too complex you can "Pin" your button or view to the top or bottom, sides, etc.

    enter image description here

    enter image description here

    Or you can do your constraints manually here:

    enter image description here

    The first method works really well and is super easy! I had a similar problem as you looking for tools that have been left out in Xcode 6 and found this wonderful tutorial on Auto Layout:

    http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1

    If you are trying to center it I would click on the button or view you are working on and look at the size inspector here:

    enter image description here

    Look at where I circled and make sure that the bottom space and the top space are equal to the same amount (mine aren't equal), but that should give you the center.

提交回复
热议问题