My issue is same as question: How to disable the the light that appears when touching a UIBarButtonItem?
I have read answer if we use Interface builder. What if I add toolbar programmatically? How can I avoid the light on the bar button item?
My issue is same as question: How to disable the the light that appears when touching a UIBarButtonItem?
I have read answer if we use Interface builder. What if I add toolbar programmatically? How can I avoid the light on the bar button item?
To do what you want programatically you can do
UIBarButtonItem *item;
UIButton *b2=[[UIButton alloc] initWithFrame:frame];
[b2 addTarget:self action:@selector(settings:) forControlEvents:UIControlEventTouchUpInside];
//you can set the background image or whatnot
[b2 setBackgroundImage:[UIImage imageNamed:@"settings.png"] forState:UIControlStateNormal];
item=[[UIBarButtonItem alloc] initWithCustomView:b2];
//then set the button on the UIToolbar through the items property