【发布时间】:2019-02-16 03:41:17
【问题描述】:
我尝试用 searchBar 显示推送子视图控制器,动画期间出现闪烁的灰色条(见图 2),我该如何修复该动画?谢谢。
代码:
override func viewDidLoad() {
super.viewDidLoad()
if title == nil {
title = "Title"
}
if #available(iOS 11.0, *) {
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.searchController = searchController
}
definesPresentationContext = true
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let vc = ViewController()
vc.hidesBottomBarWhenPushed = true
navigationController?.pushViewController(vc, animated: true)
}
【问题讨论】:
-
你试过将 pushViewController 动画设置为 false 吗?
-
不,因为我需要这个动画。
标签: ios swift uisearchbar ios11 uisearchcontroller