在两个屏幕上运行的 iOS 应用程序(无镜像)
我创建了一个 iPad 应用程序,其中包含幻灯片,当用户点击该幻灯片时,他/她可以输入一些信息。
我现在想做的是通过AirPlay(或者电缆,如果可能的话,但这似乎只是镜像)连接电视和iPad时,在电视上显示幻灯片内容
可以这样做吗?我们能否让幻灯片在电视和 iPad 上运行,然后当用户点击 iPad 上的幻灯片时,凭据输入屏幕将显示,但在电视上仍然会显示底层幻灯片而不是凭据?
在 iOS 中如何做到这一点?是否可以在电视上显示应用程序的一部分?所以不镜像整个应用程序。
I've created an iPad app which contains a slideshow and when this slideshow is tapped by the user he/she can entered some information.
What I'd like to do now is to display the slideshow contents on a TV when connecting the TV and iPad through AirPlay (or cable if possible, but that only seems to mirror things)
Can this be done? Can we have the slideshow run on the TV and also on iPad and then when the user taps the slideshow on the iPad the credentials input screen will show but on TV still the underlying slideshow will show and not the credentials?
How can this be done in iOS? Is it possible to display a portion of the application on the TV? So not mirroring the entire application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以编写应用程序来使用 Airplay 和 Apple TV 处理 2 个 UIScreen,然后为 TV UIScreen 和 iPad UIScreen 设置单独的根视图控制器。然后在电视的视图控制器上显示图像或幻灯片,并从 iPad 视图控制器的事件中运行它!
CLIFS 评论后修改:
因此,首先在 didFinishLaunchingWithOptions 或 didFinishLaunching 中的应用程序委托中设置一个通知以接收屏幕确实连接。
然后,您需要保留对单独窗口的引用,并将控制器推送到它,就像处理任何其他窗口一样。
You can write the app to handle 2 UIScreens using Airplay and an Apple TV then set a seperate root view controller for both the TV UIScreen and for the iPad UIScreen. Then display the image or slideshow on the TV's view controller and run that from the events of you iPads view controller!
AMENDED AFTER CLIFS COMMENT:
So firstly in your app delegate in didFinishLaunchingWithOptions or didFinishLaunching setup a notification to receive the screen did connect.
Then you need to keep a reference to your separate window and push controllers to it as you would any other window.
iOS 5.0 中似乎存在一个错误,这使得这个问题变得棘手。您必须从正在运行的任务栏启用镜像(在通过 API 检测到第二个屏幕之前一直向左滚动)。我已在此处的问题中发布了详细信息:如何在第二个屏幕上使用 iOS 5+ AirPlay
There appears to be a bug in iOS 5.0 which makes this tricky. You have to enable mirroring from the running task bar (scrolling all the way the left before a second screen is detected via the API. I've posted details in my question here: How to use iOS 5+ AirPlay for a second screen