调整Xcode 6中的测量中心 [英] Adjust Center of Measure in Xcode 6
问题描述
在新的Xcode 6中,缺少更改按钮测量中心的功能。
在Xcode 5中:
如果你试图将它居中,我会点击按钮或查看你正在工作在这里看看尺寸检查员:
看看我圈出的位置并确保底部空间和顶部空间等于相同的数量(我的不相等),但是应该给你中心。
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
When I put an item (like a button or label) somewhere, I am unsure of the center, so my code that deals with the item is incorrect.
The "center" shown here in Xcode 6 is measured from the top left of the item, not the actual center.
How should I fix this so it is measured from the center like here, in Xcode 5?
If your layout isn't too complex you can "Pin" your button or view to the top or bottom, sides, etc.
Or you can do your constraints manually 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:
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.
这篇关于调整Xcode 6中的测量中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!