Customise the UISearchBar in Swift

Please find the steps to customise the UISearchBar as given below:

UISearchBar contains the UITextField which can be identified through key “searchField”.

Therefore we can access the UITextField through the key and perform necessary changes with it.

Change Search Bar Background Color

Change Search Bar Text Color

Change Search Bar Placeholder Color

Change Search Bar Default Image Color

The left hand default search image in UISearchBar represents the left view of the UITextField.

The Image is rendered to change it to the desired colour.

Hope it will help you in customising the UISearchBar in your app.

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close