0
因此,我在Cocos2D的OpenGL視圖中添加了UITextView。 做了一些旋轉,以適應我的風景和所有。但不知何故,當整個場景旋轉時,textview不會。我試過Cocos2D UITextView不與GLView一起旋轉
[[[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中有這個 #define GAME_AUTOROTATION kGameAutorotationUIViewController 所以我想它已經定義了?自動旋轉適用於gl組件,只有textview不能正確旋轉。 – Sev
試試這行[[[CCDirector sharedDirector] openGLView] addSubview:self];不使用窗口。 – PeakCoder
它的工作原理!萬分感謝! – Sev