ios - How to change the color of the UISearchBar Icon? -


i don't know how modify original searchicon's color.

enter image description here

you can use custom image of white search icon, search bar not modify supplied image. set custom image, use method. (link documentation.)

- (void)setimage:(uiimage *)iconimage forsearchbaricon:(uisearchbaricon)icon            state:(uicontrolstate)state; 

example code:

[searchbar setimage:[uiimage imagenamed:@"searchicon"]    forsearchbaricon:uisearchbariconsearch               state:uicontrolstatenormal]; 

in swift:

searchbar.setimage(uiimage(named: "searchicon"), for: .search, state: .normal) 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -