In my app i have an option for adding notes to particular tips.the button for adding notes is at the top.So i want to highlight that particular button when a notes is added.If a Tip has a note attached the notes icon should light up / glow (somehow look different), so that it can quickly identify this tip has a note attached.How can i implement this one.Is it possible.Can any one Please help me.Thanks in advance
Asked
Active
Viewed 391 times
3
-
Just to clarify; whats the issue you're trying to work out here, is it to actually access the button you want to modify, or are you asking how we can add a light up / glow to a UIButton? – Madhu Sep 14 '11 at 05:18
-
@Madhumal Gunetileke Actually i want to glow up the toolbar button when a note is added and not to glow up when there is no notes are added. – suji Sep 14 '11 at 05:20
-
You can make use of a custom UIButton and add two different images to it...One is normal state and change the image to glowing image whenever a tip has a note attached with it...Hope this helps.. – stack2012 Sep 14 '11 at 05:22
-
@booleanBoy,this button is a toolbar button.so there is no custom property for this na.. – suji Sep 14 '11 at 05:26
1 Answers
3
We used some special button in tool bar in an application. We make it following way.
UIButton* btnInfo = [UIButton buttonWithType:UIButtonTypeInfoLight];
[btnInfo addTarget:self action:@selector(verInfoBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *modalButton = [[UIBarButtonItem alloc] initWithCustomView:btnInfo];
Here main point is to use [[UIBarButtonItem alloc] initWithCustomView:btnInfo];
method.
Check if it can be helpful...

Mohammad
- 1,636
- 1
- 13
- 17
-
To do this with XIB you have to write a Class that inherits BarButtonItem and decorate custom view inside that class and provide reference of that class in Class Identity section of interface builder. Honestly speaking do not have experience of decorating bar button from XIB like this so I cannot tell you how to write that class. If you do not have much problem in removing button from XIB and adding it through code would be much easier. – Mohammad Sep 14 '11 at 07:56