我有一个问题,我使用自定义单元格UITableView
,当我点击超过一根手指(2 根手指或更多)时,每个单元格上tableview
的一些问题labels
(显示信息)丢失了文本(它是空的)。所以我尝试在我的桌子上禁用多点触控,但它不受影响。我尝试添加tableView.allowsMultipleSelection = NO;
或tableView.multipleTouchEnabled = NO;
进入cellForRowAtIndexPath or didSelectRowAtIndexPath
. 但没有任何工作。请帮我找出解决方案。
谢谢!这是我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int row = indexPath.row;
@synchronized (self) {
if (row == [voicemailItems count]) {
// User selected the blank rows
[tableView deselectRowAtIndexPath:indexPath animated:YES];
// Blank out the play button on previous selected row
[self deselect];
return;
}
}
if (selectedRowIndexPath != nil) {
if (row == selectedRowIndexPath.row) {
// Selecting the same row twice will play the voicemail
if (streaming == NO) {
if (calling == NO) {
// Play the voicemail
[NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(playVoicemailAction:) userInfo:indexPath repeats:NO];
}
return;
}
else {
// Streaming VM
if ([self isCallInProgress] == YES) {
[ScreenUtils errorAllert:@"Cannot play voicemail while call is in progress." type:kUINotice delegate:self];
}
else {
if (![self isVoicemailNotification:selectedRowIndexPath.row]) {
// Stream the voicemail
[NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(playVoicemailAction:) userInfo:indexPath repeats:NO];
}
}
}
}
else {
// Selecting a different row
[self shutdownPlayer];
[self cancel];
// Blank out the play button on previous selected row
[self deselect];
}
}
selectedRowIndexPath = indexPath;
// Enable Call Back button
// Don't enable if private, etc.
btnCallBack.enabled = ([self canCallBack:row] &&
!calling &&
([self isCallInProgress] == NO) &&
![self isVoicemailNotification:selectedRowIndexPath.row]);
// Enable and Delete button
btnDelete.enabled = YES;
// Select the cell
VoicemailCell * cell = (VoicemailCell*)[tblView cellForRowAtIndexPath:indexPath];
[cell select:YES playing:[self isPlaying] stream:streaming];
[tblView setNeedsDisplay];
//[tableView deselectRowAtIndexPath:indexPath animated:YES];
}