ios - How to change border and icons in Search bar (Swift) -
i have this:
http://postimg.org/image/ag29m3e7d/
and need
http://postimg.org/image/4bacislw5/
i have create border or set image? how change search icons(magnifier , x icon) or change colors?
sorry links cannot insert images here.
to add borders use views layer
property.
self.searchbar.layer.bordercolor = uicolor.bluecolor().cgcolor self.searchbar.layer.borderwidth = 1
if want add corner radius searchbar:
self.searchbar.layer.cornerradius = 3.0 self.searchbar.clipstobounds = true
to change searchicon call following method on searchbar:
self.searchbar.setimage(image, icon: uisearchbaricon. uisearchbaricon.search, state: uicontrolstate.normal)
to change cross:
self.searchbar.setimage(image, icon: uisearchbaricon. uisearchbaricon.clear, state: uicontrolstate.normal)
Comments
Post a Comment