手指按下时
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;方法调用
highlighted:YES;
手指离开时
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;方法调用
highlighted:NO;
手指选中cell离开
-(NSIndexPath*)tableView:(UITableView*)tableView willSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
if(self.JsonArray.count!= indexPath.row) {// 可以点击
return indexPath;
}else{
return nil;// 不可以点击
}
}
手指选中cell离开
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[supersetSelected:selectedanimated:animated];
if(selected) {
self.SQringhtImage.hidden=NO;
}else
{
self.SQringhtImage.hidden=YES;
}
// Configure the view for the selected state
}
手指选中cell离开
-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
}
依次顺序进行调用,记录下来方便以后查看!!!!
后续.....在- (void)setSelected:(BOOL)selected animated:(BOOL)animated里面设置了cell上一张图片显示隐藏,然后想让对应cell默认为选中,则需要使用以下代码...
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone];
网友评论