Search code examples
iosxcodeios-simulatorscalesimulator

iOS - changing Xcode simulator screen size


I'm using Xcode 7 and am having trouble with matching the simulator to the view displayed in Xcode. The simulator screen seems to "zoomed in" too much and as a result, some of the objects located near the edges of the view are not displayed when running the simulator.

Deployment target: 9.0
Devices: Universal
Target scheme: iPhone 6

I did some reading about Xcode's autolayout but can't seem to figure out the settings that need to be changed. (How can to fit simulator according to my device screen?)


Solution

  • If simulator is 'zoomed in' you can scale it by 'window -> scale' to 75%, 50% or lower. You can also use command+1,command+2,...command+4 shortcut in your keyboard while simulator selected. If you already done this, You can change size of view controller in Attribute Inspector. To do this, you need to select view controller in storyboard file -> select Attribute Inspector in Utilities -> In Simulated Metrics, change 'Size' from 'Inferred' to 'iPad full screen' or 'iPhone 5.5-inch' (In your case, use 'iPhone 4.7-inch' for iPhone 6). This will display view controller to same size as your simulator/device. You can also change the orientation right below size. Yes, By doing this you will set interface for specific orientation/sizes. You need to learn Auto Layout to set objects at right locations in different devices/screen size.