objective c - Programmatically make color filled UIBarButtonItem -


i have uibarbuttonitem uibarbuttonsystemitemsearch type. can programmatically change tint color, so:

searchbutton.tintcolor = [uicolor purplecolor]; 

however, i'm trying figure out way programmatically "fill" button (i.e. magnifying glass) given color. more generally, i'm trying use change in icon indicate search functionality active.

i built in search icon, lack of obvious fill functionality annoying. there way without creating entirely custom button/icon? if not, what's easiest way utilize existing search icon create custom button does have ability filled?

first off suggest using tintcolor show selected/unselected states without trying mess shape since easier , convey you're trying do. keep in mind in specific case, magnifying glass may not right if filled in, shape specific , people used seeing empty space in circle.

if want continue on route though, no cannot change built-in search icon. options 1. programmatically take snapshot of such icon on screen , try manipulate using coregraphics (not great solution) or better solution 2. get/make own image , don't have of programmatically.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -