Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Mike Kohl
PLUS
Mike Kohl
Courses Plus Student 6,793 Points

Centering a Button in iOS

I'm using xcode 4.6.2

I want to drop a button on the storyboard and auto center it.

The video I watched showed an "Arrange" drop down in the "Size Inspector". In the Arrange drop down you can chose "Horizontal Center" to center a button. I don't see the "Arrange" drop down in my Size Inspector.

I did find out I can go to the editor menu, select align and then select Horizontal Center In Container.

I don't like using the menu.. I was wondering where my missing "Arrange" drop down is in the "Size Inspector". Did apple move it on my version of xcode?

1 Answer

Mike Kohl
PLUS
Mike Kohl
Courses Plus Student 6,793 Points

Guess this is not a good place to ask a question.

Just in case someone has the same problem I had. This is the solution.

The reason why I did not see the "Arrange" drop down was because "Use Autolayout" was checked.

You will need to click on "Show the File Inspector" icon, which is located near the "Show the Size Inspector"

Scroll down till you see "Interface builder document" there you should see the checkbox "Use Autolayout"

If you check "Autolayout" the "Arrange" drop down will not be displayed in the "Size Inspector"

If you uncheck "Autolayout" you will see the "Arrange" drop down in the "Size Inspector"

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Sorry you had a delay, Mike! Usually our students chime in pretty quickly. Amit is currently out of office and I'm manning the iOS questions in the forum and I am just getting to this one today.