我們對自定義的cell,使用多選功能的時候沒有效果?
1.檢查自己的tableview.editing = yes / tableview.allowMutlpleSelction = yes,
設(shè)置為編輯狀態(tài),可多選
2.查看自己的自定義cell的控件是否加載到了self.contenView上面 如果直接加載在self上是不會有選中效果的
3.cell的selectionStyle 不能設(shè)置為none,否則沒有選中效果
4.可以自己定義選中的背景顏色
cell.multipleSelectionBackgroundView = [[UIView alloc] initWithFrame:cell.bounds];
cell.multipleSelectionBackgroundView.backgroundColor = [UIColor clearColor];
5,選中后發(fā)現(xiàn)有的控件的背景顏色不見了,那么你需要在cell下實現(xiàn)這樣的一個方法:
-(void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
self.flagLabel.backgroundColor = [UIColor colorWithHexString:Color_Blue];
}
需要對控件再定義一下背景顏色。