Amit
Amit

Reputation: 1670

Remove Cancel Button background tint in Search Bar

I'm using XCode 8.2.1 to develop an iOS App. If you look carefully at the Cancel button in the image below, you can see that it has a light shade of blue as the background. I've been trying to remove this background from the Cancel button with no luck so far:

Cancel button tint background

I realized it is a low opacity shade of whatever color I give as the "Tint". If I set the tint to "Clear color", this annoying background is gone, but the "Cancel" text also gets disappeared.

Tint selection Xcode

How can I remove this background from the cancel button?

Upvotes: 0

Views: 406

Answers (2)

Amit
Amit

Reputation: 1670

If anyone else is facing this problem, this is how I solved it:

enter image description here

I removed this scope title and the tint was gone. I don't know how it got there in the first place!

Upvotes: 1

Vignesh J
Vignesh J

Reputation: 257

You can hide the cancel button using following code

searchController.searchBar.showsCancelButton = false

Upvotes: 0

Related Questions