Нижняя строка панели навигации (с контроллером поиска) мигает, когда я прокручиваю в iOS (iPhone X).Перепробовал много решений, но ни одно из них не сработало.Вот мой код:
(я не использую раскадровку)
AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow()
let viewCtrl = TabController()
let navCtrl = UINavigationController(rootViewController: viewCtrl)
self.window?.rootViewController = navCtrl
self.window?.makeKeyAndVisible()
return true
}
TabBarController
class TabController: UITabBarController {
init() {
super.init(nibName: nil, bundle: nil)
self.viewControllers = [ViewController()]
self.navigationItem.searchController = UISearchController(searchResultsController: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.barTintColor = .white
navigationController?.navigationBar.tintColor = .white
navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
}
}
ViewController
class ViewController: UITableViewController {
init() {
super.init(nibName: nil, bundle: nil)
self.view.backgroundColor = .white
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 100
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
cell.textLabel?.text = "Test"
return cell
}
}
Помощь будет высоко оценена.