I'm trying to create a simple ios 6 app. I've added a View and a Button inside my initial view controller, which was created by story board.
I'm trying to understand how orientation works with views/buttons/images/etc.
When I launch the simulator, the first problem I see is that it defaults to landscape for some reason. I would have expected the default to be portrait. How do I adjust this? In my view controller I have the following:
-(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; }
-(BOOL) shouldAutorotate { return YES; }
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationMaskPortrait; /* I get an implicit cast. I warning here too. */ }
I've also tried modifying the Supported Interface Orientations in the Summary tab to support but no luck there either.
- When I change the orientation through the simulator or my phone, the View disappears or becomes really thin. How do I keep the width at 100% no matter what orientation I'm in? I've attached a few screen shots.
This is how it's suppose to look:
But when I change the orientation, this happens: