Lal Krishna
Lal Krishna

Reputation: 16180

UISearchBar Design glitch on Xcode 11.1

UISearchBar design results weird when Build with Xcode 11.1.

I created ViewController and presented from another one. UISearchbar is added below to the UINavigationBar via Storyboard.

Build With Xcode 11.0:

Build With Xcode 11.0

Build With Xcode 11.1:

Build With Xcode 11.1

Why it happened? If this should be the behaviour, how to achieve the first design. How to fix it?

Upvotes: 2

Views: 89

Answers (1)

Lal Krishna
Lal Krishna

Reputation: 16180

As Anbu.Karthik commented, I realised, when compiled in Xcode 11.1, searchTextField's background color to clear color, and we have to set background color explicitly.

Swift:

searchBar.searchTextField.backgroundColor = .white

Obj-C

self.searchBar.searchTextField.backgroundColor = [UIColor whiteColor];

Upvotes: 1

Related Questions