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

Problem with CGRect and Frame in "Understanding Views and View Controllers"

Hi there,

I have a problem with the CGRectMake stuff in the above mentioned course.

It works perfectly when I try to move around and resize labels, but for buttons I can't change the position for some strange reason. I can use the "setTitle"-method, which works fine.

But self.showQuote.frame = CGRectMake(0, 0, 100, 100); simply doesn't do anything, even though labels work fine.

Any suggestions?

Best, Simon

1 Answer

Found the problem. Auto Layout needed to be disabled for the button in the Story Board.