Questions tagged [uisearchbar]

A view class in iOS (Apple) that implements a text field control for text-based searches.

The control provides a text field for entering text, a search button, a bookmark button, and a cancel button. The UISearchBar object does not actually perform any searches. You use a delegate, an object conforming to the UISearchBarDelegate protocol, to implement the actions when text is entered and buttons are clicked.

References:

3698 questions
149
votes
11 answers

How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar

I'm trying to implement search code in my CoreData-based iPhone app. I'm not sure how to proceed. The app already has an NSFetchedResultsController with a predicate to retrieve the data for the primary TableView. I want to make sure I'm on the…
jschmidt
  • 2,898
  • 3
  • 24
  • 27
100
votes
25 answers

How can I change the UISearchBar search text color?

How can I change the text color of a UISearchBar?
MrTourkos
  • 1,922
  • 2
  • 18
  • 22
75
votes
5 answers

How to change background color of UISearchBar in iOS7

How to change background color of UISearchBar in iOS7? not gray, I want to change color like my uinavigationbar if I Use this code, that's what comes out searchBar.backgroundColor = [UIColor redColor]; That is not red color!!! This exact same…
70
votes
8 answers

iOS 11 SearchBar in NavigationBar

With iOS 11 Apple has redesigned the UISearchBar by making the corners rounder and the height bigger. Adding a UISearchBar to the navigationBar is pretty simple by just setting it as the titleView of the navigationItem using navigationItem.titleView…
PatrickDotStar
  • 1,654
  • 1
  • 19
  • 20
68
votes
26 answers

How to change inside background color of UISearchBar component on iOS

I know how to remove/change UISearchBar background color around search field: [[self.searchBar.subviews objectAtIndex:0] removeFromSuperview]; self.searchBar.backgroundColor = [UIColor grayColor]; But don't know how to do this inside it like…
Borut Tomazin
  • 8,041
  • 11
  • 78
  • 91
66
votes
12 answers

iOS 7 UISearchDisplayController search bar overlaps status bar while searching

I'm updating my app for iOS 7, and I'm in the process of adjusting all my views to account for the new transparent status bar (my app will still use opaque navigation bars). It was relatively easy to adjust for the status bar in every view, except…
64
votes
10 answers

Get search bar in navigation bar in Swift

So I've tried everything trying to get a search bar into the navigation bar in Swift. But sadly I haven't gotten it working, just yet... For those of you who don't know what I'm talking about, I'm trying to do something like this Note the search…
idris
  • 1,019
  • 1
  • 9
  • 22
62
votes
11 answers

How to make keyboard dismiss when I press out of searchbar on Swift?

I try to make my searchbar on swift, but I have a problem to dismiss keyboard on screen when I pressed out of searchbar. When I try with textfield, it works perfectly fine with this code. override func touchesBegan(touches: NSSet, withEvent event:…
aji
  • 651
  • 1
  • 5
  • 10
61
votes
10 answers

Change UISearchBar/Keyboard Search Button Title

In the UISearchBar control, is the a way to change the Search key title for the keyboard to Done?
Jim B
  • 2,267
  • 6
  • 24
  • 26
58
votes
15 answers

UISearchBar presented by UISearchController in table header view animates too far when active

I am using UISearchController to present a search bar inside the header view of a tableview: ... self.searchController.hidesNavigationBarDuringPresentation = NO; self.presentingTVC.tableView.tableHeaderView =…
Zoë Smith
  • 1,084
  • 1
  • 11
  • 19
58
votes
22 answers

Cannot set searchBar as firstResponder

I have a searchBar I'm setting in a tableviewcontroller. i've referenced this similar question UISearchBar cannot become first responder after UITableView did re-appear but am still unable to set it as first responder. In .h file: @property…
57
votes
13 answers

Customize UISearchBar: Trying to get rid of the 1px black line underneath the search bar

My question is already specified in the title: I would like to get rid of the black line drawn on the bottom of the UISearchBar. Any ideas? Here's an image of what I mean: UPDATE: I think that the line is part of the UITableView's tableHeaderView.…
strave
  • 1,491
  • 2
  • 16
  • 26
56
votes
10 answers

Remove Border of UISearchBar in iOS7

I'm trying to remove border of UISearchBar in iOS 7. In iOS 6 it's working fine. I created the UISearchBar programatically. I tried almost every thing from Stack Overflow and Google. SearchBar looking right now What i want to achieve I tried all…
iEngineer
  • 1,319
  • 1
  • 11
  • 27
56
votes
16 answers

Light gray background in "bounce area" of a UITableView

Apple's iPhone apps such as Music and Contants use a search bar in a UITableView. When you scroll down so that the search bar moves down, the empty space above the scroll view's contents has a light gray background color (see screenshot). (Notice…
T .
  • 4,874
  • 3
  • 23
  • 36
55
votes
13 answers

iOS 9 searchBar disappears from table header view when UISearchController is active

The structure: View1 (click a button) -> present modally (MyModalView: UITableViewController) MyModalView has UISearchController embedded. The searchBar of UISearchController is placed in MyModalView.tableView.tableHeaderView. It's been working fine…
David Trang
  • 1,434
  • 1
  • 10
  • 10
1
2 3
99 100