- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MomentsReportCell *cell = [MomentsReportCell getCellWith:tableView];
if (_selectedIndex == indexPath.row) {
cell.imvSelected.hidden = NO;
_beforeSelectedIndex = indexPath;
}
if (_arrDataCause.count > 0) {
cell.lblTextLeft.text = DSStringValue(_arrDataCause[indexPath.row][@"reportComment"]);
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//去除之前選中的
MomentsReportCell *beforeCell = [tableView cellForRowAtIndexPath:_beforeSelectedIndex];
beforeCell.imvSelected.hidden = YES;
//給選中的限制按鈕
MomentsReportCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.imvSelected.hidden = NO;
_selectedIndex = indexPath.row;
[_tbvMomentsReport reloadData];
}
cell選中
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
推薦閱讀更多精彩內(nèi)容
- 情景:前幾日寫代碼的時候遇到一個問題,當cell被選中的時候,cell上按鈕的背景色消失,跟cell選中的背景色重...
- collectionView的cell中重寫下面兩個方法 - (void)setSelected:(BOOL)se...
- 項目需求,cell的自定義contentView沒有占滿整個cell,導(dǎo)致點擊時點擊效果很難看,可以自定義cell...
- //懶加載 -(NSArray *)allColors { if(_allColors==nil) { _allC...
- 在實際的過程中,我們或多或少能遇到這樣的圖,就是上邊紅框固定,但是底下的要顯示可選狀態(tài),這個一共有兩種方法 1.將...