Andrei Neacsu
Andrei Neacsu

Reputation: 1473

iPhone - Status bar rotate even if the app supports only Portrait orientation

I am developing an iPhone application that supports only Portrait orientation. On my device everything works OK, but on my tester's the status bar is autorotating to landscape orientation. The rest of the view remains in Portrait mode.

My tester's device specs are these: - iPhone 4 - Ver 4.2.8

I couldn't reproduce this error on my device (iPhone 4, 4.3.3).

Thanks!

Upvotes: 2

Views: 1972

Answers (1)

Nishant B
Nishant B

Reputation: 2897

Add below function in your all viewController.m files.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); // support only portrait
}

Add below key in your info.plist file

Initial interface orientation

And set it's value as "Portrait (bottom home button)"

Cheers.

Upvotes: 2

Related Questions