将 iPad 屏幕镜像到 VGA
我尝试使用适用于 iPad 的 iphoneos-screen-mirroring 镜像一个简单的新 TabBarApplication 的屏幕:
http://code.google.com/p/iphoneos-screen-mirroring/
每次(也不包括代码)如果我尝试在模拟器模式下激活电视输出,应用程序就会崩溃而不会出现错误。
如果外部电视输出被激活,它将保持黑色(包括代码)。
应用程序委托:
#import "iPadVGAAppDelegate.h"
#import "UIApplication+ScreenMirroring.h"
@implementation iPadVGAAppDelegate
@synthesize window;
@synthesize tabBarController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] setupScreenMirroringWithFramesPerSecond:20.0];
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
return YES;
}
I tried mirroring the screen of a simple new TabBarApplication with iphoneos-screen-mirroring for iPad:
http://code.google.com/p/iphoneos-screen-mirroring/
Everytime (also without including the code) if I try to activate the TV-out in Simulator mode the app crashes without errors.
If the external TV-out is activated it staies black (code includet).
appDelegate:
#import "iPadVGAAppDelegate.h"
#import "UIApplication+ScreenMirroring.h"
@implementation iPadVGAAppDelegate
@synthesize window;
@synthesize tabBarController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] setupScreenMirroringWithFramesPerSecond:20.0];
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
return YES;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我看到了同样的行为。我认为它使用的技术意味着你必须在真实设备上进行测试。对我来说,在真实设备(iPad)上相同的代码运行得很好。
I saw the same behaviour. I think the technique it uses means you have to test on a real device. The same code on a real device (iPad) for me worked fine.
看看这里 http://www.touchcentric.com/blog/archives/123
Rob Terrell 的 TVOutManager 就是解决方案。
下一行就是您所需要的:
[[TVOutManager sharedInstance] startTVOut];
Take a look here http://www.touchcentric.com/blog/archives/123
Rob Terrell's TVOutManager is the solution.
The next line is all your need:
[[TVOutManager sharedInstance] startTVOut];