• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UISearchBar over UINavigationBar with custom background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UISearchBar over UINavigationBar with custom background color


  • Subject: UISearchBar over UINavigationBar with custom background color
  • From: Rick Mann <email@hidden>
  • Date: Mon, 02 Nov 2015 18:56:20 -0800

I'm using a UISearchController with the presenting VC as the results controller. I want to display the search bar (field and cancel button) over my UINavigationBar. I want the background color of the search bar to be the same as my navigation bar (0, 47, 64, 1.0). But when I try to set its barTintColor, I get (0, 248, 248), a gaudy bright blue. I'm creating it with this:

	self.searchController = UISearchController(searchResultsController: nil)
	self.searchController!.searchResultsUpdater = self
	self.searchController!.searchBar.delegate = self
	self.searchController!.hidesNavigationBarDuringPresentation = false
	self.searchController!.dimsBackgroundDuringPresentation = false
	self.searchController!.searchBar.barTintColor = UIColor(colorLiteralRed: 0, green: 47, blue: 64, alpha: 1.0)

I've tried a number of variations, short of generating a UIImage filled with that color to set as the background image.

Any ideas? Thanks.


--
Rick Mann
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: NSControl Multiple Values
  • Next by Date: More of a dev tools question, so please advise if this is the wrong place to ask - automating the Network Link Conditioner
  • Previous by thread: Re: Crash running C code built on OS X El Capitan in Xcode 7
  • Next by thread: More of a dev tools question, so please advise if this is the wrong place to ask - automating the Network Link Conditioner
  • Index(es):
    • Date
    • Thread