Landscape orientation in iPhone
Categories: iPhone, OOP, others on May.20, 2009
If you have problem with landscape
When we set landscape mode:
1. In plist.info add string
1 2 | <key>UIInterfaceOrientation</key> <string>UIInterfaceOrientationLandscapeRight</string> |
2. In AppDelegate file
1 2 3 4 5 6 7 8 9 10 11 | - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after application launch [window addSubview:[myViewController view]]; [window makeKeyAndVisible]; [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; application.statusBarOrientation = UIInterfaceOrientationLandscapeRight; } |
This string for landscape mode of Alert and many other objects!
1 | application.statusBarOrientation = UIInterfaceOrientationLandscapeRight; |
3. And in ViewController.m file
1 2 3 4 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); } |
Similar posts:


May 23rd, 2009 on 6:38 pm
Достаточно интересно, я вообще не очень люблю блоги но этот читаю с удовольствием!