Cocos2d, How Set Device Orientation to portrait IOS

465 Views Asked by At

I had followed this http://www.cocos2d-x.org/wiki/Device_Orientation

but my RootViewController.mm not exactly look like that.

After i replace 'UIInterfaceOrientationMaskAllButUpsideDown' to 'UIInterfaceOrientationMaskPortrait' there is some error on main.m

my cocos2d version = cocos2d-x-3.13.1 , on iPhone 7 simulator

1

There are 1 best solutions below

0
On BEST ANSWER

You also need to go to xcode project setting and choose device orientation. Here is a screenshot.

enter image description here