【问题标题】:tvOS 14.3 UISearchController: How to locked in displaytvOS 14.3 UISearchController:如何锁定显示
【发布时间】:2021-02-01 21:49:36
【问题描述】:

短版,有没有办法让这个14.3看起来

在 14.3 之前进入这个

长版, 在每次操作系统迭代中,UISearchController 的外观都会发生变化。在它只更改键盘部分但在 14.3 之前它更改了键盘部分在左侧,而搜索结果在右侧,这是我们不喜欢的,因为我们有自定义视图和覆盖在它上面。

是否有任何 API 可以使其恢复到上一个​​迭代,即键盘都在一条水平线上,搜索结果在底部,并且永远保持这种状态?

这是集成的代码。 14.3 的 UI 外观确实让应用程序整体变得混乱。

_searchResults = [[UITableViewController alloc] init];
_searchController = [[UISearchController alloc] initWithSearchResultsController:_searchResults];
_searchController.searchResultsUpdater = self;
_searchController.view.backgroundColor = [UIColor clearColor];
_searchController.searchBar.keyboardAppearance = UIKeyboardAppearanceDark;
_searchController.searchBar.placeholder = @"TV Shows, Movies, Keywords";
_searchController.obscuresBackgroundDuringPresentation = false;
_searchController.hidesNavigationBarDuringPresentation = true;
 
_searchContainer = [[UISearchContainerViewController alloc] initWithSearchController:_searchController];
_navController = [[UINavigationController alloc] initWithRootViewController:_searchContainer];     
[_navController willMoveToParentViewController:self];
[self addChildViewController:_navController];
[self.view addSubview:_navController.view];

【问题讨论】:

    标签: uikit tvos uisearchcontroller tvos14


    【解决方案1】:

    没有更改键盘外观的代码,但只是在您的设备设置上进行了更改:

    Settings>General>Keyboard = Auto

    但你可以改为“线性”或“网格”

    有关更多信息,请参阅视频: Discover search suggestions for Apple TV

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-01
      相关资源
      最近更新 更多