2

I am working on ios 7 & ios 6 3.5 inches and 4 inches screen for ios. I am working on a splash screen for both versions. In ios 7 4-inches screen it display the proper way. In iOS 6 with a 4-inch screen it is not display properly. I have issues with alignment. iOS 7 with 3.5 inches is also getting some alignment issues. But iOS 6 with 3.5 inches it displays find. I dont know how to fix the alignment issues. This is my sample code:

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
{
    splashView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 20, 320, 548)];
    splashView.image=[UIImage imageNamed:@"screens copy.png"];
    [self.view addSubview:splashView];
    splashView.autoresizingMask =  UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |UIViewAutoresizingFlexibleBottomMargin  | UIViewAutoresizingFlexibleTopMargin;
}
else
{
    splashView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
    splashView.image=[UIImage imageNamed:@"small-screen1.PNG"];
    [self.view addSubview:splashView];
    splashView.autoresizingMask =  UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |UIViewAutoresizingFlexibleBottomMargin  | UIViewAutoresizingFlexibleTopMargin;
}
5
  • Whats wrong with Launch Images.This is for Splash Screen functionality. Mar 10, 2014 at 6:32
  • have you designed 2 splash images?? one for iphone 4,4s(320,480) size and another for iphone 5,5s(320,568) size??
    – NiravPatel
    Mar 10, 2014 at 6:32
  • Any reason why you're creating splash screens instead of using Launch Images?
    – Isuru
    Mar 10, 2014 at 6:36
  • @user3222991 Plz c my answer. Its not necessary to provide splash screens via coding. You have now two methodologies to implement splash screens and app icons: Asset Catalog or Old School
    – madLokesh
    Mar 10, 2014 at 6:43
  • @user3222991 were you able to resolve your issue.
    – madLokesh
    Mar 10, 2014 at 9:50

4 Answers 4

7

Hope this would help you see through your problem:

Splash Screens

Splash Screens Info

The image displays the naming convention of splash screens. You can either use assets catalog or go old school.

Update

Old pattern would be helpful for the iPhone app developed in X-code 5. To implement this-

Uncheck from Launch Image Assets

Update and add iPhone Default splash screen images

Update2

Hint

Check out this SO Question

6
  • @madLokesh.thanks for your response.iam applying to given ur answer.But same problem getting Mar 10, 2014 at 6:47
  • @user3222991 could you edit your question and post the screenshot as well. Also, plz confirm do you have the relative images of the same as well. Use the 'eye' icon to check whether images are being loaded properly.
    – madLokesh
    Mar 10, 2014 at 6:51
  • my image dimension for 4 inches screen "640*1136 pixels" amd 3.5 inches screen image dimension "640*960 pixels" Mar 10, 2014 at 6:52
  • Another important tip: Avoid using spaces in image nomenclature. Use special characters like _ , - or ~
    – madLokesh
    Mar 10, 2014 at 6:52
  • what about non retina. Do uyou have 320 x 480 as well
    – madLokesh
    Mar 10, 2014 at 6:54
1

You should provide the different size of launch images in Images.xcassets -> LaunchImage in your project using Xcode. That will solve your problem. No need to manually detect version & take overheads.

0

What you can do is just drag and drop 2 splash images of size (640*960)Default.png and (640*1136)[email protected].

then select Use Asset Catalog in Launch Images option in Targets -> General.

And your splash screen will be displayed properly

enter image description here

let me know it is working or not!!!!

Happy Coding

0

Why don't you use the Default.png & Defau[email protected]. It will be automatically shown as splash screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.