【发布时间】:2018-02-07 21:04:01
【问题描述】:
我正在开发一个 TVOS 应用程序。我使用下面的代码在 UITabBarController 中实现搜索功能。显示标签栏然后搜索栏被标签栏覆盖的问题。请参阅下面的屏幕截图。如果显示标签栏,是否可以将搜索栏位置向下移动?
let searchViewController = VVSearchViewController()
let searchController = UISearchController(searchResultsController: searchViewController)
searchViewController.searchViewController = searchController
searchController.searchResultsUpdater = searchViewController
searchController.obscuresBackgroundDuringPresentation = true
let searchPlaceholderText = "Search"
searchController.searchBar.placeholder = searchPlaceholderText
searchController.searchBar.tintColor = UIColor.black
searchController.searchBar.barTintColor = UIColor.black
searchController.searchBar.searchBarStyle = .minimal
searchController.searchBar.keyboardAppearance = .dark
searchController.view.backgroundColor = UIColor.black
searchController.definesPresentationContext = true;
UISearchContainerViewController(searchController: searchController)
【问题讨论】:
标签: swift uisearchbar tvos uisearchcontroller