tags:

views:

83

answers:

1

according to my code when my device are use in Landscape

when i pushViewController it will

automatic show in UIDeviceOrientationPortrait.

i need to rotate my device to Portrait and then rotate to Landscape,

then it will present in Landscape mode.

how can i rotate to current of Orientation with out use of private API(setOrientation)?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIDeviceOrientationPortrait) ||
            (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
A: 

Try setting the status bar orientation:

UIApplication *app = [UIApplication sharedApplication];
[app setStatusBarOrientation: UIInterfaceOrientationLandscape];
[app setStatusBarHidden: NO animated: YES];

You can get the current device orientation like this:

[UIDevice currentDevice].orientation
Plamen Dragozov
thanks Plamen Dragozov
RAGOpoR
it not answer my question.
RAGOpoR