iOS示例“GLPaint”不能支持纵向人像,肖像颠倒

时间:2011-04-25 07:55:34

标签: iphone ios ipad

我想在示例代码“GLPaint”上支持方向纵向和纵向颠倒。 这个应用程序的代码是什么代码支持方向纵向和纵向颠倒?

示例代码“GLPaint” http://developer.apple.com/library/ios/#samplecode/GLPaint/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40007328

此示例使用Object窗口而不是子类UIViewController。 我尝试了这段代码,但没有用。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))
return YES;
return NO;
}

我尝试修改应用程序以设置视图控制器2模式。

答:GLPaint添加子类View Controller。 B:新项目OpenGL ES应用程序添加GLPaint。

两者都不好。 目前,我不知道源代码有什么问题。

1 个答案:

答案 0 :(得分:1)

将PaintingView放入构建的视图控制器中,它在我身边很有效。 View Controller可以控制界面方向。

相关问题