How to highlight the button untill the next view is changed in iphone?
Posted
by Pugal Devan
on Stack Overflow
See other posts from Stack Overflow
or by Pugal Devan
Published on 2010-04-19T10:34:36Z
Indexed on
2010/04/19
10:43 UTC
Read the original article
Hit count: 366
Hi,
I am new to iphone development. I have created five buttons in the view controller. If i clicked the button it goes to the corresponding view. Now i want to display the button in highlighted state when it is clicked. It should go back to the normal state only when i click the other button.(See the image below). I have set the another image for highigthting buttons when i clicked it, but it shows that highlighted state only one sec. Now i want to display the buttons highlighted till another button is clicked. Same like a Tabbar operations.(I have used buttons instead of tabbar for my requirements).
Now i have used the following code,
void didLoad
{
[btn1 setImage:[UIImage imageNamed:@"ContentColor.png"] forState:UIControlStateHighlighted];
[btn2 setImage:[UIImage imageNamed:@"bColor.png"] forState:UIControlStateHighlighted];
[btn3 setImage:[UIImage imageNamed:@"ShColor.png"] forState:UIControlStateHighlighted];
[btn4 setImage:[UIImage imageNamed:@"PicturesColor.png"] forState:UIControlStateHighlighted];
[btn5 setImage:[UIImage imageNamed:@"infoColor.png"] forState:UIControlStateHighlighted];
}
Please help me out.
Thanks.
© Stack Overflow or respective owner