I have a button added to a UITableViewCell
, at the end. When highlighted, I have a custom highlight layer with transparency on the end. However, the button still gets dimmed, though it's still working. But the user can get the idea it has become inactive. I would like the button to stay as it is, even as the cell is highlighted. I would like to understand why and how the button gets dimmed, even if the highlight layer has full transparency there.
Asked
Active
Viewed 516 times
0
-
Have you set yourButton.isEnabled = FALSE ? – Nishant Tyagi Apr 20 '13 at 16:46
-
Not specifically. And the button is just functioning, that's not the issue. The thing is, it is dimmed when the table cell gets selected, even when the custom highlight layer has a transparency over there. – Pip Apr 21 '13 at 17:35
-
http://stackoverflow.com/questions/2769290/uibutton-also-highlighting-when-cell-is-touched – Pip Apr 21 '13 at 17:45
-
I suspect the button state to go to highlight when the cell is highlighted. I want the button to stay as it is. – Pip Apr 21 '13 at 17:46
-
cell.selectionStyle = NO leaves the button alone, but now the whole cell is not responding as one select it. – Pip Apr 21 '13 at 17:48
2 Answers
0
overriding some stuff to fix this.
I tried, but I don't know how to get 'yourButton' to be the button that is in the cell?
0
This finds the button and sets its highlighted state to NO.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
for(UIView *views in cell.subviews)
{
if(views.tag == indexPath.row){
for(UIButton *deKnop in views.subviews)
{
deKnop.highlighted = NO;
}
}
//if ( [views isKindOfClass:[UIButton class]] ) {
//do your code
//[subviews setImage:[UIImage imageNamed:@"PENCIL.png"] forState:UIControlStateHighlighted];
//}
}

Pip
- 159
- 2
- 9
-
In the simulator I can hardly discover any flickering, but I guess there technically is. – Pip Apr 21 '13 at 18:44