ios - How to change the color of the UISearchBar Icon? -
i don't know how modify original searchicon
's color.
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
Post a Comment