button inside table view cell shows highlighted state on tapping on cell
Posted
by Vivek Dandage
on Stack Overflow
See other posts from Stack Overflow
or by Vivek Dandage
Published on 2010-04-10T11:06:14Z
Indexed on
2010/04/10
11:13 UTC
Read the original article
Hit count: 386
uitableviewcell
|iphone
Hi there!
I have an issue with the background image of button which is dependent of button state. I have a button inside customized table view cell and i have set different images for button's different states. Please look into the code below.
[btnNow setImage:[UIImage imageNamed:@"now_norm.png"] forState:UIControlStateNormal]; [btnNow setImage:[UIImage imageNamed:@"now_focus.png"] forState:UIControlStateHighlighted];
Whenever i tap on the actual button this works great but if i tap on area outside of button but which is still inside that same cell then this button changes its background image from UIControlStateNormal to UIControlStateHighlighted.
If i remove background image from UIControlStateHighlighted state then this issue doesn't exists but i need pressed state of the button.
Please help me out.
Thanks in advance!
Vivek Dandage.
© Stack Overflow or respective owner