views:

33

answers:

1

Hello all,

my app run in landscape mode i want it to be always in one form i.e suppose the background is stackoverflow picture in this case stack will be beside the ear speaker and flow beside home button i want when the user rotate the iphone 180 degree (still landscape mode) now flow will be beside the ear speaker and stack beside home button NB: i need all the view rotate not only the background

thanks

+1  A: 

Override

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

in your view controller and return YES for any orientation you want to support.

eg:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
            (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
            (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
}

that will return YES for all orientations except upside down.

Jasarien
thanks for answer but it work 100% in simulator but not working in the device why ?
Bobj-C
Do you have the orientation lock enabled?
Jasarien
how i check this ? sorry i'am new to all this stuff
Bobj-C
Double press the home button and swipe on right the multitask bar to reveal the controls from the left side. There is an orientation lock control.
Jasarien
Thank you, i forgot that i have the orientation lock enabled. all work properly
Bobj-C