uisearchbar

Search Bar disappeared from view while typing

北慕城南 提交于 2020-01-02 10:14:45
问题 I added SearchBar to my TableView in ViewDidLoad() doing it: self.searchBar = UISearchController(searchResultsController: nil) self.searchBar.searchResultsUpdater = self self.searchBar.dimsBackgroundDuringPresentation = false self.searchBar.searchBar.sizeToFit() self.tableView.tableHeaderView = self.searchBar.searchBar self.tableView.reloadData() everything works fine, but when I tap on this SearchBar it disappears. It means, I can still typing, and I can see the results but, don't see

How to change UISearchBar Font Size & Color?

这一生的挚爱 提交于 2020-01-02 08:49:32
问题 I've google fews hours how to change my UISearchBar font size & color, but I cannot any documents related to it. This is what I've done so far on swift 4: searchBar = UISearchBar(frame: CGRect(x: 0, y: 0, width: view.frame.width - (menuImage.frame.width + iconImage.frame.width + 55), height: 30)) searchBar.placeholder = "SEARCH BAR" searchBar.tintColor = UIColor.gray searchBar.delegate = self searchBar.font = [UIFont fontWithName:@"Oswald" size:11]; but it gave me an error. Could you tell me

iOS 7, scope bar becomes black in search mode

爷,独闯天下 提交于 2020-01-02 08:45:06
问题 I use UISearchDisplayController embedded to UiTableViewController to make a search bar in my table view. But if I set the search bar's background image, the scope bar do not show in search mode, but showing a black bar instead. It's very weird because it does not happen in iOS 6. Note that the image I used to set the search bar's background image is 640x90 px, somehow the scope bar will show if use other image. Even if I set the scope bar background image, it sill not show depend on the

Adding SearchBar to NavigationBar Objective-C iOS 9

陌路散爱 提交于 2020-01-02 05:40:08
问题 I think the title is pretty self explanitory. I have a tableView embedded in a navigation controller and want to add a search bar to the navigation bar. I think something changed in iOS 9 regarding searchbar controller things so keep in mind this has to be for iOS 9. This is what i have. No doubt it is wrong. UISearchController *searchController = [[UISearchController alloc]init]; self.searchController.searchBar.barTintColor = [UIColor whiteColor]; [self.navigationController

Swift 4 - iOS 11 Search bar scope won't appear as it should

余生颓废 提交于 2020-01-01 16:31:10
问题 I have an app which works nice and without any problems on iOS 10 but with iOS 11 and Xcode Beta 5, I have this strange problem with search bar scope where the scope bar seems like it was cut from the bottom. (It was the same with all versions of Xcode beta and iOS 11) I would really really be glad if someone can put me in the right direction. Thanks Above you can see what I see when I press the hamburger menu button. No problem here.. searchbar also has a scopebar which shows up when clicked

how to set iOS 6/7 Deltas programmatically

天大地大妈咪最大 提交于 2020-01-01 08:04:57
问题 I was developing a UISplitView app by using Xcode 4.6 when I left iOS6 I had design: Now I migrate to new Xcode5 and now I have this design: UINavigationBar overlaps completelly my UISearchBar... Leo Natan told me about using a iOS 6/7 Deltas but since I'm creating and adding my UISplitViewControllers programmatically, this may doesn't work I need to set the iOS 6/7 programmatically but I don't know how, any help I'll appreciate 回答1: In iOS 7 there are now extended edges, and that's why

How can I add a search bar above a UICollectionView?

╄→尐↘猪︶ㄣ 提交于 2020-01-01 04:22:08
问题 I would like to allow users of my app to search for images using a UISearchBar above a UICollectionView . According to my understanding, a UICollectionView must be in a UICollectionViewController to work properly. However, Xcode won't let me put a search bar in a UICollectionViewController . I also can't use a generic UIViewController as the collection view won't work properly. How can I achieve the functionality that I want? 回答1: CollectionView + SearchBar with Swift3 + Storyboard

Scope Bar for UITableView like App Store?

强颜欢笑 提交于 2019-12-31 13:27:09
问题 Does anyone know how to add a scope bar to a UITableView ? The App Store app does this sometimes, like in the picture below. I would like to use this scope bar to add sorting options for the elements in the UITableView . This would be more convenient than having a toolbar with a UISegmentControl . I just don't know how to implement this. I don't even know the name of the element (I'm calling it scope bar because it looks just like the scope bar of a UISearchBar , but it is not). 回答1: The

How to programmatically add a search bar to a UITableView header?

不问归期 提交于 2019-12-31 05:12:16
问题 How would i go about programmatically adding a search bar into a uitableview header? Specifically i have a bar button item that when it's pressed i would like to animate in a search bar into the table view header and when the cancel button is pressed it will animate back out of the view and the header scales back to normal. Would this be possible? Thanks. 回答1: It's based on Swift 2 but It's not very diff to swift 3 Add search delegate to view controller: UISearchResultsUpdating Make a search:

NSPredicate omits special characters like á â á in filterContentForSearchText method

你。 提交于 2019-12-31 04:06:08
问题 I am developing an app with an UISearchBar and I need to filter some names with special characters like à, è, ê and so on.. but if I don't type the correct string with the special character it doesn't appear. Ex: If I am looking for cómodo word I can't find this word if I don't type exactly có How could I get that word without type that special characters? for example typing just co . This is my NSPredicate : NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"SELF.word