4 ms·
as for "photo album:" are you sure that app rotates? My guess is that it doesn't, so obviously it won't on the simulator. Not every app rotates, remember. Until
by allenbrunson 17y ago
as for "photo album:" are you sure that app rotates? My guess is that it doesn't, so obviously it won't on the simulator. Not every app rotates, remember. Until very recently, the only one of Apple's apps that did is Safari.
I have gotten my own apps to rotate in the simulator just fine. You have to make that decision at the view controller level. Investigate the UIViewController method shouldAutorotateToInterfaceOrientation:
- ROFISH 17y agoIn addition, there's a Info.plist key/value, UIInterfaceOrientation with the value UIInterfaceOrientationLandscapeRight or UIInterfaceOrientationLandscapeLeft, that lets you set the default rotation level and the simulator will start the app in the correct rotation. EDIT: Also the autorotation only works on ViewControllers. If you only have Views without ViewControllers, (such as the default OpenGL app from the wizard) they will not rotate.
- InkweaverReview 17y agoWould I have to set up two views within Interface Builder, one for landscape and one for portrait, or do I use the one single view and rotate it using code?
- allenbrunson 17y agoyou just use one view. implement that view controller method i mentioned, and always return TRUE. you must do this for every view in your app, if you want them to all work in landscape modes. that's all you have to do, as far as the iphone is concerned. of course you'll have to draw the view contents differently, when you're in landscape mode.
- InkweaverReview 17y agoI'm going to look through the Apple sample code and see if I can find an example that changes orientation properly. So far none of the sample code apps that I have found rotate. Once I find one that does I'll be able to check the code and see how it is done.