ios - Storyboard iOS 中的 Chromecast miniview

标签 ios objective-c chromecast

要在应用程序中显示带有 chromecasting 视频控件的迷你 View ,需要以编程方式更改 Root View 。需要将以下代码添加到 Storyboard 中。

  // 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 controller app,rootview 从 storyboard 开始。有人可以帮我更改或修改 rootview 以在 tabbar 应用程序中获取 miniView(容器 View )吗?

最佳答案

在使用选项卡 View 时更改 Root View 对我来说并不是强制性的,只需尝试在选项卡上添加完整的 navigationController 对象本身。 通过这种方式,在任何一个选项卡上都会有带有控件的迷你 View 。

关于ios - Storyboard iOS 中的 Chromecast miniview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57722173/

相关文章:

iPhone——可以区分指尖和整个指腹吗?

chromecast - Google Cast CAF 接收器和 DRM + 不记名 token

android - 使用 CastPlayer 更改字幕

iphone - 在 Objective-C 中搜索字符串的最快方法是什么?

ios - 如何通过自定义 URL 将 "property-list"对象传递给 iOS 应用程序?

ios - 如何在方法声明中使用预处理器宏?

android - Chromecast 无法播放 Shoutcast Stream

ios - NSManageObjectContext 保存 - 无法识别的选择器

iphone - 无法更改字幕中 UILabel 的框架

ios - 如何根据 nsarray 过滤谓词