
Info.plist
settings-shouldAutorotateToInterfaceOrientation:
method.1) Provide Launch Images
Default.png
.Default@2x.png
. This image will get picked up by the iOS if your app is running on an iPhone 4.Default.png
and Default@2x.png
, iOS will automatically pick up Default.png
as the launch image.-
Default-PortraitUpsideDown.png
– upside-down portrait version. -
Default-LandscapeLeft.png
– left-oriented landscape version. -
Default-LandscapeRight.png
– right-oriented landscape version. -
Default-Portrait.png
– generic portrait version. -
Default-Landscape.png
– generic landscape version. -
Default.png
– default portrait launch. Its usage is strongly discouraged, use more specific launch images instead.
Default-Portrait.png
and Default-Landscape.png
. More specific launch images will take precedence over the generic versions, for example Default-PortraitUpsideDown.png
takes precedence over the Default-Portrait.png
image file for this specific orientation.See the ios reference guide site “Providing Launch Images for Different Orientations” section on the iPad Programming Guide for more information.
Default.png
and Default@2x.png
. Name your iPad portrait launch image Default-Portrait.png
(do not use Default.png
as the iPad portrait launch image).Update Your Info.plist Settings
Info.plist
file:-
Specify values for the
UISupportedInterfaceOrientations
key for the supported orientations. -
Specify values for the
UIInterfaceOrientation
key for the initial launch orientation.
That method doesn’t cause the interface to rotate, it just decides if the device is ALLOWED to.
So if you want to change the factors you use to determine if rotating is allowed, you’ll have to create an instance variable.
make your header have something like this:
@interface MyClassName : NSObject { BOOL canLandscape; }
In your “other” method, set that flag (canLandscape = YES;
).
In your shouldAutorotateToInterfaceOrientation:
, you can check this to help you decide
if (canLandscape) { ...dosomethinghere... }