How do I add a UIActivity Indicator to every Cell and maintain control of each individual indicator

前端 未结 4 1881
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 14:39

I\'m trying to add an activity indicator to certain cells in my UITableView. I do this successfully in the method didSelectRowAtIndexpath using

    CGRect CellFr         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-21 15:06

    Assuming that activity view indicator tag is unique in the cell.contentView you can try something like:

    UITableViewCell *cell = [tableview cellForRowAtIndexPath:indexpath];
    
    UIActivityIndicatorView *acView = (UIActivityIndicatorView *)[cell.contentView viewWithTag:1];
    
    //acView will be your activitivyIndicator
    

提交回复
热议问题