From e6b9bb7afb6a9c099a4ea1f7ae2f8a0c8ec2884c Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Tue, 7 Feb 2017 13:23:18 +0800 Subject: [PATCH] fix a bug in UI in lanscape mode --- pass/PasswordsViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pass/PasswordsViewController.swift b/pass/PasswordsViewController.swift index 5106b8b..48dfd10 100644 --- a/pass/PasswordsViewController.swift +++ b/pass/PasswordsViewController.swift @@ -76,6 +76,12 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV } } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + searchBarView.frame = CGRect(x: 0, y: navigationController!.navigationBar.bounds.size.height + UIApplication.shared.statusBarFrame.height, width: UIScreen.main.bounds.width, height: 44) + searchController.searchBar.sizeToFit() + } + func numberOfSections(in tableView: UITableView) -> Int { return sections.count }