iOS spriteNode background image differences between ios 7 and ios 8

alexsc

i'm facing this problem on iOS(objective-c, not swift). I load a background image from images.xcassets and it displays properly on iOS 8, but not on iOS 7. Have anyone faced this problem before ?

This is the code i'm using:

    SKSpriteNode *background = [SKSpriteNode spriteNodeWithImageNamed:@"xxx"];
    background.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
    [self addChild:background];

There are also differences in layouts (i'm not using xibs), but the first step is to solve the background :).

Below are the screenshots from ios 7 % ios 8. enter image description here enter image description here

Here is a screenshots with images.xcassets:

enter image description here Thanks,have a great day, Alex.

alexsc

Seems that ios 7 doesn't recognize that your app is launching in landscape mode so the frame is initialized with the portrait dimensions. I solved this with the following method :

- (CGSize)screenSize {
    CGSize screenSize = [UIScreen mainScreen].bounds.size;
    if ((NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) && UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
        return CGSizeMake(screenSize.height, screenSize.width);
    }
    return screenSize;
}

You can find out more by searching for 'orientation-dependency' in iOS 8. Hope this will be usefull for you too.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

iOS spriteNode background image differences between ios 7 and ios 8

From Dev

Differences between iOS 7 to iOS 7.1

From Dev

iOS 8 UINavigationBar Background Image

From Dev

iOS 8 UINavigationBar Background Image

From Dev

[UIScreen mainScreen].bounds.size differences between iOS 7 and iOS 8

From Dev

Differences between iOS 7 API and iOS 6 API

From Dev

Image Background Issue in IOS7

From Dev

iOS 7 Navigationbar background image issue

From Dev

Differences between Android and iOS regarding Intents and background operations

From Dev

UIWebView Rendering differences in iOS 6 and iOS 7

From Dev

alert in background ( ios 7 )

From Dev

iOS 7 view background

From Dev

iOS 7 - Pass data (image) between ViewController

From Dev

This working in iOS 7 not iOS 8

From Dev

This working in iOS 7 not iOS 8

From Dev

"presentViewController" and Orientation problems between iOS 7 and iOS 8

From Dev

Different NSError localizedDescription between iOS 7 and 8

From Dev

Stretch iOS background image

From Dev

Uploading image in background ios

From Dev

Uploading image in background ios

From Dev

iOS 7 : set an image(for background image or a View) dynamically during runtime?

From Dev

backBarButtonItem image in iOS 8

From Dev

iOS 7 UINavigationBar Background image hides Title view

From Dev

Can UIBarButtonItems in a Toolbar have a Background Image in iOS7?

From Dev

Can't set IOS 7 simulator home background image

From Dev

how to set background image in uitableview cell in ios7?

From Dev

iOS 7 UINavigationBar Background image hides Title view

From Dev

UINavigationBar background image for both iOS6 and 7

From Dev

UINavigationBar + iOS7 background image not setting properly

Related Related

HotTag

Archive