Search Bar background color Gray ios7

Search Bar background color Gray ios7

uisearchbar textfield background color swift 4
search bar color
ios 13 search bar text color
uisearchbar textfield background color swift 5
search bar background color swift
uisearchcontroller textfield background color
change search bar background color swift
uisearchbar placeholder text color

I am currently working on an app that worked fine until ios7 came along. The search bar used to be transparent and blended into the blue background of the navigation bar. Now that I am working in ios7, the nav bar is blue, however the search bar has a gray background to it. How do I make it blue or transparent?

Here is an image:

Try this:

    self.searchBar.searchBarStyle = UISearchBarStyleMinimal;

iOS13: Xamarin.Forms SearchBar BackgroundColor not behaving , This style of search bar has a translucent background with the color of the Application bar, if no color is set, the default color (gray) is used. The google search function works, i.e. it finds a site corresponding to the search words, but the "touch screen" function is froozen/gray below the "Web Images Videos ..etc. line. Nor will it go to the other active safari screens.

You can set "Bar Tint" to "Clear Color" in Interface Builder (.xib):

It can also be done in code:

self.searchBar.barTintColor = [UIColor clearColor];

iOS 7 Search Bar Style, Hi, You can customise of UISearchBar in Swift. Can Add Then, check out this post on StackOverflow: How to change background color of UISearchBar in iOS7 Finally, go back to your device home screen and check the dock color. That’s all, mate! Besides a change in dock color, you will notice a reduction in transparency everywhere on your iPhone. For example, folders will have a solid background. Similarly, widgets, Control Center, search bar, etc. too, will have reduced transparency. Wrapping up…

To make it a flat color, you simply need to remove the UISearchBarBackground view.

I created a recursive method to properly clean the search bar.

- (void) removeUISearchBarBackgroundInViewHierarchy:(UIView *)view
    for (UIView *subview in [view subviews]) {
        if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) {
            [subview removeFromSuperview];
            break; //To avoid an extra loop as there is only one UISearchBarBackground
        } else {
            [self removeUISearchBarBackgroundInViewHierarchy:subview];

You can simply send your search bar to the method and change the color afterward.

[self removeUISearchBarBackgroundInViewHierarchy:self.searchDisplayController.searchBar];
self.searchDisplayController.searchBar.backgroundColor = yourUIColor;

How to set the UISearchBar text field background color, The default color is also changed to light gray, as well. Changing the Background Color of Navigation Bar. In iOS 7, the tintColor property is no  Question: Q: Background color change to grey after iOS 7.01 upgrade Hi all, Updgraded to 7.01 this morning, and what used to be this beautiful tranparent background become this ugly grey.

Swift 4.2

You can use this extension to change Font and Background color of the SearchBar.

extension UISearchBar {

    var textField: UITextField? {
        let subViews = subviews.flatMap { $0.subviews }
        guard let tf = (subViews.filter { $0 is UITextField }).first as? UITextField else { return nil }
        return tf

    func setTextColor(color: UIColor) {
         textField?.textColor = color

    func setBackgroundColor(color: UIColor) {
         textField?.backgroundColor = color

iOS 7 Programming Tips: Customize Navigation Bar and Status Bar, I am trying to set the color of the "search bar and search display controller" using However, when the app runs, the color doesn't seem to be black, but some sort of gray, with Getting control of the iOS 7 search bar background color is tricky. Starting with Windows 10 build 14946, you can change the color of the search box to white when set to show a search box on the taskbar instead of an icon. The default color of the search box will be a faded version of the color you selected to show on the taskbar .

**Edit - This worked for me in iOS 7

// Set the color to whatever blue color that is in your screenshot
self.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor redColor] cornerRadius:5.0f];

If you want all of your search bar's to be a certain color do this:

// Put this in your app delegate's didFinishLaunchingWithOptions method
// Whatever color you want for searchBarColor
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { // For iOS 7
    UIColor *searchBarColor = [UIColor blueColor];
    [[UISearchBar appearance] setBackgroundColor:searchBarColor];

If you just want that particular search bar background to be a color:

// Set it in your viewDidLoad method of your controller
// Replace the yourSearchBar property with whatever you're doing to instantiate the search bar
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { // For iOS 7
    UIColor *searchBarColor = [UIColor blueColor];
    self.yourSearchBar.backgroundColor = searchBarColor;

Can't set search bar with search bar display color iOS7, If the app icon you are using has a white background, a 1 pixel gray border Since iOS 7, Apple has been using a vibrant color palette for the Search bars come in two different styles by default: prominent and minimal. While I was using chrome, the address bar mysteriously started to have a black background. Some things say that this is a consequence of having windows dark theme turned on, however, in those cases, the entirety of chrome seems to adopt a dark theme. So, this seems like a bug to me. I want my chrome to be back to the way it was. Thanks.

The iOS Design Guidelines, Swift Tool Belt, Part 8: Extending UIButton with Background Color for iOS 7 notoriously broke away from skeuomorphism and introduced  By returning UI Status Bar Style Light Content, you reverse the content color within the status bar to white. If you use the UI Status Bar Style Default it will set the status bar content color to black. Regrettably, black and white are the only colors offered for your iOS 7 colors within the task bar.

Extending UIButton in Swift with Background Color for State,