【问题标题】:iOS sample "GLPaint" can't support orientations portrait, portrait upside-downiOS 示例“GLPaint”不支持方向纵向、纵向倒置
【发布时间】:2011-04-25 07:55:34
【问题描述】:

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

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

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

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

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

A:GLPaint 添加子类 View Controller。 B:New Project OpenGL ES Application 添加 GLPaint。

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

【问题讨论】:

    标签: iphone ios ipad


    【解决方案1】:

    将 PaintingView 放入内置视图控制器中,它在我这边运行良好。 View Controller 可以控制界面方向。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-01
      • 1970-01-01
      • 2022-08-16
      • 2018-10-11
      • 1970-01-01
      • 1970-01-01
      • 2012-11-16
      相关资源
      最近更新 更多