我面临一个奇怪的问题。我想显示一个自定义单元格而不突出显示它。我的表中的UITableViewCell
有5个元素,比如UILabel,UIImage等。问题是当我点击单元格时有时候不会显示alertview。这是我didSelectRowAtIndexPath
中的代码:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:LocalizedString(@"Please input") delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
return;
我正在对此进行广泛的研究。首先,我改变了:
cell.selectionStyle = UITableViewCellSelectionStyleNone
到
cell.selectionStyle = UITableViewCellSelectionStyleDefault
UIView *bgColorView = [[UIView alloc] init];
bgColorView.backgroundColor = [UIColor myCellColor];
[cell setSelectedBackgroundView:bgColorView];
由于我不想突出显示,我将单元格的高亮颜色设置为单元格背景颜色,但问题是,它也突出显示分隔符。因此,当我点击分隔符更改的颜色时,它看起来不太好。
我想知道如何在没有自定义单元格的情况下解决这个问题。
编辑备注:
总是调用 didSelectRowAtIndexPath
,但并不总是显示AlertView。
简单的UIAlertController或UIAlertView无关紧要。两者有时都不会显示。