iOS app 1.6 background on rotation

Hi all,

 

Got a problem with iOS app background on horizontal position: it applies vertical background instead.

I check the device position like this:

 

    UIInterfaceOrientation orientation = [[UIApplicationsharedApplication] statusBarOrientation];

    BOOL inLandscape = UIDeviceOrientationIsLandscape(orientation);

    

    if (inLandscape == true)

    {

        self.view.backgroundColor = [UIColorcolorWithPatternImage:[UIImageimageNamed:BX_SCREEN_BG_IMAGE_LAND_IPAD]];

    }

    else 

    {

        self.view.backgroundColor = [UIColorcolorWithPatternImage:[UIImageimageNamed:BX_SCREEN_BG_IMAGE_IPAD]];

    }

but if I put this into - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation it checks only on device rotation event. When clicking "Back" or "Cancel" button on one of the internal screens after changing the device position it doesn't work and applies the background incorrectly.

 

Does anyone have solved this issue?

http://boonexpert.com
Quote · 15 Feb 2013

Try to do the same in viewWillAppear func.

Rules → http://www.boonex.com/terms
Quote · 16 Feb 2013

Did the same with viewWillAppear, viewWillDisappear and viewDidLoad, doesn't help. Can't find the function which calls on "Back" button press.

http://boonexpert.com
Quote · 16 Feb 2013

Seems like this works:

- (void) viewDidAppear:(BOOL)animated{

    [self checkRotation];

}

 

checkRotation - function to check the device orientation.

viewDidAppear fires each time you see the view on the screen.

http://boonexpert.com
Quote · 16 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.