// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskLandscape;
return UIInterfaceOrientationMaskPortrait; // 세로 화면
#endif
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
NSInteger mask = 0;
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskLandscape;
//return UIInterfaceOrientationMaskPortrait; // 세로 화면
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationPortrait])
mask |= UIInterfaceOrientationMaskPortrait;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationPortraitUpsideDown])
mask |= UIInterfaceOrientationMaskPortraitUpsideDown;
#endif
return mask;
}
-(NSInteger)supportedInterfaceOrientations{
NSInteger mask = 0;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeRight])
mask |= UIInterfaceOrientationMaskLandscapeRight;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeLeft])
mask |= UIInterfaceOrientationMaskLandscapeLeft;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationPortrait])
mask |= UIInterfaceOrientationMaskPortrait;
if ([self shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationPortraitUpsideDown])
mask |= UIInterfaceOrientationMaskPortraitUpsideDown;
return mask;
}
6.0 이상만 가능.....
Constants
UIInterfaceOrientationMaskPortrait
The view controller supports a portrait interface orientation.
UIInterfaceOrientationMaskLandscapeLeft
The view controller supports a landscape-left interface orientation.
UIInterfaceOrientationMaskLandscapeRight
The view controller supports a landscape-right interface orientation.
UIInterfaceOrientationMaskPortraitUpsideDown
The view controller supports an upside-down portrait interface orientation.
UIInterfaceOrientationMaskLandscape
The view controller supports both landscape-left and landscape-right interface orientation.
UIInterfaceOrientationMaskAll
The view controller supports all interface orientations.
UIInterfaceOrientationMaskAllButUpsideDown
The view controller supports all but the upside-down portrait interface orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape( interfaceOrientation );
return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
안드로이드는
android:screenOrientation="landscape"
landscape를 portrait로 변경
'Apple - IPhone / IPod Touch > cocos2d-x' 카테고리의 다른 글
ios 의 status bar 없애기.. (0) | 2013.10.17 |
---|---|
cocos2d-x iOS7 으로 바뀐 후 갑자기 텍스트 폰트가 나오지 않을때.. CCLabelTTF 문제가 아님. (1) | 2013.10.04 |