Milo
Milo

Reputation: 5091

iOS - Part of interface not showing up in simulator - Interface Builder

I'm having a problem where everything shows up fine in the view for interface builder but then when I run the app in the simulator some of my labels and buttons look like they've been scratched out or something. Its really weird and really bugging me. I've tried re - adding the buttons to see if it helped and changed things like color and text size but nothing seems to work.

Please note that I am running OS X Mountain Lion in a virtual machine (I actually went out and bought a copy of the OS I don't pirate.) I have not tried on an actual device as I cannot afford the $99 to get a license. Here is a screenshot of the interface builder next to the simulator: http://gyazo.com/b9aa180aaee4944c1a7a364c3b6e7029

Even though I'm running it in a virtual machine, I've never encountered this problem before, it doesnt effect anything else and I've even restarted it, added more VRAM and everything and nothing changes so I don't think that its the VM. It's definitely XCODE.

HELP!

EDIT: Here is a download link for a sample project showing this issue: http://www.mediafire.com/download/sw4jx7wvcgpbxlv/TestCalc.zip

Upvotes: 2

Views: 3585

Answers (1)

f26e
f26e

Reputation: 115

This is an issues concerning AutoLayout. If you turn off the option "Use Layout" in your .xib, all labels are displayed correctly.

So something must go wrong while setting the constraints. It seems, like the content hugging priorities of the buttons were equal but too low. As a result, some button labels were cut off (alternating from one compile to another). For me setting the vertical "Content Hugging Priority" of each button object to required (= 1000) fixed this problem.

Upvotes: 3

Related Questions