我正试图在没有镜像模式的情况下使用Airplay在Apple TV上显示图片.但是,当镜像关闭时,[UIScreen screen]方法总是返回1个屏幕(主屏幕).我希望我的图片显示与Photo应用程序相同(没有镜像的Airplay).
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidDisconnect:) name:UIScreenDidDisconnectNotification object:nil];
Run Code Online (Sandbox Code Playgroud)
我使用过它们,但只有在镜像开启时才能使用它们.
请帮我.非常感谢!我正在使用Apple TV1和iPad 2(iOS 5.0.1)