1

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?)

Krunal
  • 77,632
  • 48
  • 245
  • 261
Vee
  • 1,821
  • 3
  • 36
  • 60
  • 1
    You need to learn Auto Layout. – Daniel Storm Nov 18 '15 at 23:11
  • @DanielStorm - I did learn Auto Layout. The problem was that I didn't know how to set the simulator screen size. Was hoping for a useful comment or direction such as Brijesh's response below. – Vee Nov 19 '15 at 23:26

2 Answers2

5

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.

  • Thanks, Brijesh. I did learn about Auto Layout but didn't know how to set the simulator screen size. Your answer is exactly what I needed! – Vee Nov 19 '15 at 23:26
1

You can't have 1:1 ratio. Read about screen resolutions.

However you can scale it from the iOS Simulator > Window > Scale menu.

Cartifon
  • 21
  • 3