关于airplay的设计/建筑问题。 我已经安装在AppDelegate中的外部显示:Airplay:外部窗口的镜子视图
UIScreen *externalScreen = UIScreen.screens.lastObject;
self.externalWindow = [[UIWindow alloc] initWithFrame:externalScreenFrame];
self.externalWindow.screen = externalScreen;
self.externalWindow.backgroundColor = [UIColor redColor];
工作正常,电视显示空白屏幕为红色。 现在我有一个ViewController与一堆子视图,一个视图应显示在设备和外部屏幕上。如果我试试这个在ViewController.m:
[_appDelegate.externalWindow addSubview:self.deviceAndTVView];
deviceAndTVView将只显示在外部屏幕上,而不是在设备上了。 我需要的是在设备上安装deviceAndTVView,通过触摸/用户交互进行更新,并在外部屏幕上对这些更新进行镜像。
哪一条是正确的?
感谢您的阅读! m
谢谢,你说得对。创建两个视图并且并行管理是唯一的选择。对于任何感兴趣的人,这在苹果文档[这里]中描述(http://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingWindows/CreatingWindows.html#//apple_ref/doc/uid/ “在外部显示器上显示内容”下的TP40009503-CH4-SW9)。 – marimba 2012-06-05 14:27:23
从iOS 7开始,您应该可以使用快照API在其他屏幕上显示特定的UIView – jjxtra 2015-03-09 02:07:35