Question

I have an UIView that takes up the entire screen and inside it I have another square UIView. I set this one to the size that I want but when I run the emulator I see it much smaller.

enter image description here

I'm using XCode 4. What am I doing wrong?

Thanks in advance

Was it helpful?

Solution

According to the constraints you have, the top of the view is a certain distance from the top, and the bottom of the view is a certain distance from the bottom. So it's not really a square view, it's just a view that looks like a square.

The reason why it's showing up as smaller is that it looks like a square when the view is run on a 4" screen.

But your simulator isn't a 4" screen (which you can clearly see because the height of the view in the simulator does not match the height of the view in Interface Builder).

So, since the simulator screen is shorter, it's forcing your view to be shorter too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top