Reputation: 22042
Already added below code in AppDelegate.m but still not working in portrait.
-(NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
Here is Xcode summary page:
Upvotes: 2
Views: 2047
Reputation: 22042
Got solution. We can set orientation in setupCocos2dWithOptions.
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupCocos2dWithOptions:@{
CCSetupShowDebugStats: @(YES),
CCSetupScreenOrientation: CCScreenOrientationPortrait,
}];
return YES;
}
Upvotes: 7