Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The image that iOS shows when app goes into background appears upside down when seen in portrait mode

Im building an iOS app which is Landscape only. When my app goes into background, the image that iOS shows in the multitasking apps list appears messed up. It is showing the landscape image upside down in portrait mode.

I'm not doing anything specific in applicationWillResignActive and applicationWillEnterForeground.

Here's an image showing the issue.

Screenshot showing the list of apps running currently

I've allowed only Landscape mode for my app by setting these in General properties and Info.plist files as shown below:

App's General properties showing Device Orientation locked to Landscape only

Info.plist file:

Info.plist file showing the supported orientations for the app

It sure does look like one of the third-party ad libraries is causing the mess-up. The issue does not occur in the ad-free version of the same app. Is there anything I can do to prevent the third party libraries from causing this mess up?

So, I'm using iAd and AdMob along with adapters to support mediation (to support InMobi, MobFox and Millennial Media).

Is there anything I can do to get this fixed?

like image 311
Bijoy Thangaraj Avatar asked Feb 04 '26 23:02

Bijoy Thangaraj


1 Answers

A workaround is to remove the ad from superview in applicationWillResignActive and re-adding it in applicationDidBecomeActive (preferably making use of NSNotifications).

So removing it would look something like this:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
    [self.adBanner removeFromSuperview];
}

And adding it:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
    [self.view addSubview:self.adBanner];
    [self.view addConstraints:@[self.adXConstraint, self.adYConstraint]];
}
like image 131
Man Eating Monkey Avatar answered Feb 06 '26 12:02

Man Eating Monkey