【问题标题】:Chromecast miniview in storyboard iOS故事板 iOS 中的 Chromecast miniview
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2012-10-11
      • 2012-01-02
      • 2011-12-28
      • 2012-08-22
      • 1970-01-01
      • 2017-05-08
      • 2012-02-17
      • 2018-04-21
      • 1970-01-01
      相关资源
      最近更新 更多