Search code examples
iosobjective-cviewxcode4

iOS Development Simulator view squashed


I have just started iOS programming and am following a tutorial on iTunesU from Stanford.

In the first tutorial we were shown how to build a simple RPN calculator. When I built and compiled in the simulator launched as normal but everything was "squashed". I figured this was because the View in XCode is bigger than the iOS simulator. How can I resize the view in Xcode or am I missing something. Here is the iOS simuator view compared with the one from xcode enter image description here

enter image description here


Solution

  • Looks like your view in Xcode's Interface Builder is a 4" view, and the simulator is running a 3.5" device. You can change either one.

    The view size in Xcode is changeable by selecting the entire view, and in the attributes inspector, you can change the size between Freeform, 3.5, 4.

    You can change the device in the simulator by going to Hardware>Device> Select your device

    However, the overlapping buttons, etc, are more related to using Auto Layout, or misused struts. You can either turn off Auto Layout and use struts, or take the challenge to learn Auto Layout. Here's a start for Auto Layout: What is Auto Layout?