獲取Cell以及獲取當前選中的Cell
//獲取cell
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
//獲取當前選中cell
NSIndexPath* indexPath = [self.tableView indexPathForSelectedRow];
tableview顯示數(shù)據(jù)撬呢,數(shù)組為空時,tableview依然顯示虛線問題。
需要給tableview的footview一個view灯帮。如:
tableView.tableFooterView = [[UIView alloc]init];
項目需求需要點擊tableview時改變cell里的控件圖片和狀態(tài)
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{//重寫高亮函數(shù)
if (highlighted) {
self.playImg.image = [UIImage imageNamed:@"icon_video_news_pre"];
self.contentView.backgroundColor = RGB(251, 233, 206);
}else{
self.playImg.image = [UIImage imageNamed:@"icon_video_news_normal"];
self.contentView.backgroundColor = RGBA(248, 248, 248, 1);
}
}