2 bluetooth99 bluetooth99 于 2013.01.06 09:55 提问

带controlEvent的UIbutton在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方法,请帮忙,谢谢。

1个回答

wangyaninglm
wangyaninglm   Ds   Rxr 2015.01.13 22:24

你参考一下这个看看,行不行:
http://blog.sina.com.cn/s/blog_71ce775e0101c3sj.html

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!