uisearchbar

How to change statusBar background color when search is active?

。_饼干妹妹 提交于 2021-02-19 02:13:22
问题 I've used UISearchController. When I click on the search bar, navigation bar hides and search bar goes to the top of the screen. But, it shows extra space between top of the screen and the search bar How do I change statusBar color to default searchBar gray color ? StatusBar font colour is white, hence when user click search bar, auto above status bar information becomes invisible.So i just need to cover that area by default gray color too, then user can see clearly the status bar.Like this

UIsearchController inside UIViewController using Auto Layout

ぐ巨炮叔叔 提交于 2021-02-18 14:15:34
问题 Has anyone been successful implementing a UIViewController that contais both a UISearchController searchBar and a UItableView while laying everything out using Auto Layout? I'm trying to achieve something similar to what 1Password does on the iPhone: a fixed searchBar on top of a tableView (not part of its tableHeaderView ). When the UISearchController that owns the searchBar gets activated, its searchBar animates to show the scope buttons and thus the tableView moves down a bit. I have got

UISearchController SearchBar changes after click cancel button

折月煮酒 提交于 2021-02-10 16:38:33
问题 I have UISearchController in my app: searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self if #available(iOS 9.1, *) { searchController.obscuresBackgroundDuringPresentation = false } searchController.searchBar.frame = searchBarView.frame searchBarView.addSubview(searchController.searchBar) searchController.searchBar.delegate = self The problem is that when I enter the SearchBar and then click the cancel button the search bar not back

Double tap necessary to select TableView item with Search Bar

不羁岁月 提交于 2020-12-29 12:27:08
问题 I have a UITableView with a search bar as header. I use this function to update my data when the user does a search in the search bar. func updateSearchResults(for searchController: UISearchController) { if let searchText = searchController.searchBar.text { if (searchText.characters.count > 0) { self.filteredResults = []; self.locationManager?.geocodeAddressString(addressString: searchText, completionHandler: { (results, error) in if error == nil && results != nil { self.filteredResults =

How do you keep the cancel button in the search bar enabled when the keyboard is dismissed?

孤街浪徒 提交于 2020-05-25 03:56:50
问题 I'm trying to achieve the same effect as Apple's Contacts app (left screenshot). The cancel button in UISearchBar is enabled even when the keyboard is dismissed. My app behaves differently (right screenshot). The cancel button automatically becomes disabled when the keyboard is dismissed. The user is forced to tap the cancel button one time to enable it and then another time to actually trigger the dismissal. This is not good user experience. How would I always keep the cancel button enabled