tags:

views:

143

answers:

1

Hello,

I am experiencing difficulties managing my view controller rotation. Here is my app structure :

[Window]
---[addSubview:MainViewController.view]

My MainViewController's view contains an UIImageView which I need to rotate, this is my app background.

In my AppDelegate and MainController I overrided shouldAutorotateToInterfaceOrientation to return YES, but when I rotate my device nothing change. Even the status bar.

Should I manually apply transformation to my views when I receive UIDeviceOrientationDidChangeNotification ?

In IB I set resize subviews to YES in mainViewController.view.

So I am a little bit lost...

Thanks for your help.

thierry

A: 

Actually, you should override shouldAutorotateToInterfaceOrientation: — notice the colon, it's significant in ObjC — and only in the current view controller.

@implementation MainViewController
...
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}
KennyTM
I dit it. But nothing rotate.
thierryb
@Thierryb: Does it work in the simulator?
KennyTM