I have a UIButton defined inside tableviewCellWithReuseIdentifier.
The button works, but it is very disappointing. If I just press a button, it works. Pressing it for a long time cannot trigger an action, even if it starts to blink, indicating that it knows that it has been pressed. Why is this happening? More importantly, how can I fix this.
Here is the code for the UIButton inside the cell.
CGRect rect = CGRectMake(190.0, 2.0, 40.0, ROW_HEIGHT);
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTag:LBUTTON_TAG];
[button setFrame:rect];
[button addTarget:self action:@selector(leftbutton:) forControlEvents:UIControlEventTouchUpInside];
[button setAlpha:0.5];
[cell addSubview:button];
source
share