【发布时间】:2013-12-16 14:55:36
【问题描述】:
我在 UITableview 单元格中添加了自定义 UIButton。
使用以下代码:-
UIButton *btnOtherCount=[UIButton buttonWithType:UIButtonTypeCustom];
btnOtherCount.frame=CGRectMake(577, 43, 110, 60);
[btnOtherCount setBackgroundImage:[UIImage imageNamed:@"orange.png"] forState:UIControlStateNormal];
[btnOtherCount setTitle:@" Nonfiction - Other - 0" forState:UIControlStateNormal];
btnOtherCount.titleLabel.lineBreakMode=NSLineBreakByWordWrapping;
btnOtherCount.titleLabel.textAlignment = NSTextAlignmentCenter;
btnOtherCount.titleLabel.font=[UIFont boldSystemFontOfSize:13.0f];
[btnOtherCount setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[btnOtherCount addTarget:self action:@selector(done:) forControlEvents:UIControlEventTouchDown];
[cell.contentView addSubview:btnOtherCount];
问题是,当我尝试单击单元格中的按钮时,它不会突出显示以快速触摸,或者如果我单击快速或连续触摸一个接一个等等。但是当我稳定且更有力地单击时(不是长按),它会突出显示。
重要的是在这两种情况下都会调用相应的操作方法,即在慢速点击和快速点击中。
【问题讨论】:
标签: ios objective-c uitableview uibutton