ios - Change UIBarButtonItem color when selected -


i'm using images uibarbuttonitem pure white , transparent. how can change tint color when user selects item? there method tells me button selected inside uitoolbar?

you can change tintcolor of uibarbuttonitem when user taps so:

@ibaction func mytoolbarbutton(sender: anyobject) {     mytoolbarbutton.tintcolor = uicolor.greencolor() } 

you may want use uitabbar instead if user can select 1 button @ time. uitabbar change tintcolor of button selected , change button default color when select button.

if keep uitoolbar have handle color changes yourself.


Comments

Popular posts from this blog

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

python - TypeError: start must be a integer -

html - href attribute breaking an element -