【发布时间】:2020-01-03 10:31:30
【问题描述】:
要在应用中显示带有 chromecasting 视频控件的迷你视图,需要以编程方式更改根视图。下面的代码需要添加到情节提要中。
// Wrap main view in the GCKUICastContainerViewController and display the mini controller.
UIStoryboard *appStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UINavigationController *navigationController =
[appStoryboard instantiateViewControllerWithIdentifier:@"MainNavigation"];
GCKUICastContainerViewController *castContainerVC =
[[GCKCastContext sharedInstance] createCastContainerControllerForViewController:navigationController];
castContainerVC.miniMediaControlsItemEnabled = YES;
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
self.window.rootViewController = castContainerVC;
但我制作了 tabbar 控制器应用程序,rootview 从情节提要开始。有人可以帮我更改或修改 rootview 以在 tabbar 应用程序中获取 miniView(容器视图)吗?
【问题讨论】:
标签: ios objective-c chromecast