0
這是我的代碼的UIButton與ControlEvents不工作的UITableViewCell
UIImageView *bgDetails = [[UIImageView alloc] initWithFrame: CGRectMake(0, 20, 320, 47)];
bgDetails.image = [UIImage imageNamed:@"bgDetail"];
UIButton *btnLike = [UIButton buttonWithType:UIButtonTypeCustom];
[btnLike setBackgroundImage:[UIImage imageNamed:@"38_38"] forState:UIControlStateNormal];
btnLike.frame = CGRectMake(278, 4.5f, 37, 37);
[btnLike addTarget:self action:@selector(doLike:) forControlEvents:UIControlEventTouchUpInside];
[bgDetails addSubview:btnLike];
[cell.contentView addSubview:bgDetails];
但btnLike
不調用doLike
方法。請幫幫我!謝謝!
不錯!謝謝你的回答。 –
@MrQ不客氣。 – 2013-01-05 17:39:35