Search code examples
iosxcode7scaling

Xcode scaling and framing images


I'm having an issue with framing my background image throughout iOS devices (all iPhones and iPads) I'm trying to maintain certain elements of the UI (which contain buttons) in the screen for an app built in Xcode 7. I'm using a square image as background but Xcode isn't giving me the choice of which area appears. Should I create a new storyboard for each device?iPhoneframingiPhoneframingscaling


Solution

  • Yes, you can create storyboard for each device and you have to put condition for different device in AppDelegate file - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {} method. But it is not proper way to resolve this type of issue. For that you have to add constraints. By using constraints your view appear every device compatible.