첫 번째보기를 세로보기 모드로 변경하고 두 번째보기를 가로보기 모드로 변경하려면 gameconfig.h
파일을 사용하고 있습니다.뷰를 세로 모드에서 가로 모드로 변경하려면 어떻게해야합니까?
코드는 다음과 같습니다 내가 세로 모드에서 메뉴를 표시 할 첫 번째보기에서
//
// GameConfig.h
// Cocos2DSimpleGame
//
// Created by Ray Wenderlich on 11/21/10.
// Copyright Ray Wenderlich 2010. All rights reserved.
//
#ifndef __GAME_CONFIG_H
#define __GAME_CONFIG_H
//
// Supported Autorotations:
// None,
// UIViewController,
// CCDirector
//
#define kGameAutorotationNone 0
#define kGameAutorotationCCDirector 1
#define kGameAutorotationUIViewController 2 //2
//
// Define here the type of autorotation that you want for your game
//
#define GAME_AUTOROTATION kGameAutorotationUIViewController
#endif // __GAME_CONFIG_H
and in my appDelegate file is:
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
#else
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
//[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
// [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
#endif
, 나는 새로운 게임을 클릭 할 때 또한 다음 게임은 가로 모드로 표시됩니다. 나는 shouldAutoInterfaceOrientation
도 사용하지만 해결책을 찾지 못했습니다. 당신이 방향을 변경하고자 할 때
코드를 형식화하십시오. 이렇게 읽는 건 정말 어렵습니다 ... –