書名: Cocos2d-x by Example:Beginner's Guide(Second Edition)作者名: Roger Engelbert本章字數: 77字更新時間: 2021-07-23 20:00:27
Time for action – laying down the rules
We'll update the RootViewController.mm
file.
- Go to
RootViewController.mm
inside theios
folder and look for theshouldAutorotateToInterfaceOrientation
method. Change the line inside the method to read:return UIInterfaceOrientationIsPortrait( interfaceOrientation );
- And a few lines below in the
supportedInterfaceOrientations
method, change the line inside the conditionalto
:return UIInterfaceOrientationMaskPortrait;
What just happened?
We just told RootViewController
we want our application to play in any of the two supported portrait modes.
推薦閱讀