簡體   English   中英

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

[英]iOS sample “GLPaint” can't support orientations portrait, portrait upside-down

我想在示例代碼“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。

兩者都很糟糕。 目前,我不知道源代碼有什么問題。

將PaintingView放入構建的視圖控制器中,它在我身邊很有效。 View Controller可以控制界面方向。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM