2

Could someone please tell me why [UIDevice currentDevice] orientation] always returns 0 in view did load? I want to change the layout of my screen based on current orientation. It doesn't work when I keep my device in landscap mode initially. I am expecting [UIDevice currentDevice] orientation] to return landscap orientation in that case but it doesn't. It gives right values then onwards! Could someone please help me to identify what's the issue. Thanks.

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self resizeContentViews:[[UIDevice currentDevice] orientation]];
}
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
  • Begin and Ending Rotation events doesn't make any different! – Paresh Masani Oct 10 '12 at 08:17
  • You are right. Checking Status bar orientation worked for me. Probably other didn't work because I was testing on Simulator. Please put this as an answer. I will accept it. Thanks. – Paresh Masani Oct 10 '12 at 08:29

0 Answers0