UISearchBar barTintColor clearColor error in iOS 8.0

In my application, I use UISearchBar in xib with Xcode 6. And I gave the tin bar color - pure color. He works on iOS 7.1 below.

But the main problem is that iOS 8.0 does not work clear color. It displays black color.

See image :

enter image description here

Anyone who has a gamble on this problem.

+3
source share
3 answers

I had the same problem in the search bar, so I changed the Search style from default to minimum .

And that changed the style of the bar.

enter image description here

+3
source

You can add a 1x1 pixel transparency image as a background image in the UISearchBar. That would be a dirty workaround. I think Apple should solve this problem.

+1
source

You must set the color of the UISearchBar hue.

  UISearchBar *search=[[UISearchBar alloc]initWithFrame:CGRectMake(10, 20, 100, 20)]; [search setBarTintColor:[UIColor clearColor]]; search.backgroundImage=[UIImage new]; self.navigationItem.titleView=search; 

enter image description here

0
source

Source: https://habr.com/ru/post/1202384/


All Articles