Search code examples
iosiphoneiphone-5

How to avoid the image resizing on custom splash screen


Hi Am creating iOS app with custom splash screen, the custom splash screen gets loaded after the iOS's default splash screen with some loading progress. i did set the default image as the background for my custom splash screen, but the custom splash screen image got reduced size at the top and bottom, please take a look at the screen shots,and please get out from this

thanks in advance.

Ios's default screen

enter image description here

my custom splash screen

enter image description here


Solution

  • Thank you all, Thanks a lot.

    Finally I found a trick,

    First you should hide the Status Bar during launch. By just doing this Xcode -> project Targets -> summary Tab -> Status Bar -> check the visibility.

    Then, set

    [imgsplash setImage:[UIImage imageNamed:@"Default"]];
    
    imgsplash.frame = CGRectMake([[UIScreen mainScreen] bounds].origin.x,
                                 [[UIScreen mainScreen] bounds].origin.y,
                                 [[UIScreen mainScreen] bounds].size.width,
                                 [[UIScreen mainScreen] bounds].size.height);
    
    imgsplash.autoresizingMask =  UIViewAutoresizingFlexibleBottomMargin |  
                                  UIViewAutoresizingFlexibleTopMargin | 
                                  UIViewAutoresizingFlexibleLeftMargin |
                                  UIViewAutoresizingFlexibleRightMargin;
    

    by giving [UIImage imageNamed:@"Default"] let the imageNamed can choose right image.

    Thanks.