C.Johns
C.Johns

Reputation: 10245

stop uiview rotation

I have a tableview and detail view app, in the tableview I have this to stop it from being able to rotate.

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
    return false;
}

so the main view should always be in portrait mode.

however the subview is able to change rotation freely.. if i go from the detail view while in landscape view to the parent tableview then the tableview appears in landscape and cannot rotate back.. hoping someone can help me fix this.

Upvotes: 0

Views: 213

Answers (1)

Sherman Lo
Sherman Lo

Reputation: 2759

You're telling it never to rotate, what you actually want is:

return (interfaceOrientation == UIInterfaceOrientationPortrait)

which says it should only rotate when it's to portrait orientation.

Upvotes: 1

Related Questions