Landscape orientation in iPhone
Categories: OOP, iPhone, others on May.20, 2009
If you have problem with landscape
When we set landscape mode:
1. In plist.info add string
- <key>UIInterfaceOrientation</key>
- <string>UIInterfaceOrientationLandscapeRight</string>
2. In AppDelegate file
- - (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!
- application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;
3. And in ViewController.m file
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- // Return YES for supported orientations
- return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
- }
Similar posts:



(3 votes, average: 4.33 out of 5)


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