Cocos2d iphone Cocos2D UITextView未与GLView一起旋转
因此,我在Cocos2D中的OpenGL视图中添加了一个UITextView。 做了一些旋转,以适应我的景观和所有。但不知何故,当整个场景旋转时,textview不会。我试过了Cocos2d iphone Cocos2D UITextView未与GLView一起旋转,cocos2d-iphone,orientation,uitextview,autorotate,Cocos2d Iphone,Orientation,Uitextview,Autorotate,因此,我在Cocos2D中的OpenGL视图中添加了一个UITextView。 做了一些旋转,以适应我的景观和所有。但不知何故,当整个场景旋转时,textview不会。我试过了 [[[CCDirector sharedDirector] openGLView] window].autoresizesSubviews = YES; 包括这些功能,但它仍然保持不变 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientat
[[[CCDirector sharedDirector] openGLView] window].autoresizesSubviews = YES;
包括这些功能,但它仍然保持不变
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
有什么想法吗
我已使用以下方法将其添加到openGLView中:
[[[[CCDirector sharedDirector] openGLView] window] addSubview:self];
我的类继承自UITextView。打开文件
GameConfig.h
,定义自动旋转类型。希望能有所帮助。谢谢您的回复。我在GameConfig.h#define GAME#u AUTOROTATION kgameaautorotationuiviewcontroller中检查了它,我想它已经定义好了?自动旋转适用于gl组件,只有textview没有向右旋转。请尝试此行[[[CCDirector sharedDirector]openGLView]addSubview:self];不要使用窗口。