Reputation: 10245
this weird thing is happening with my uitableview cell selection style, Instead of changing the color of the cell on selection its making the label in the cell disappear. I have no idea how to fix it.
this is the code I am using inside didSelectRowAtIndexPath
cellActivityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[cell setAccessoryView:cellActivityIndicator];
[cell setSelectionStyle:UITableViewCellSelectionStyleGray];
Upvotes: 0
Views: 9780
Reputation: 576
in didSelectRowAtIndexPath
UIActivityIndicatorView *cellActivityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[cellActivityIndicator setCenter:CGPointMake(20, 20)];
[cellActivityIndicator startAnimating];
[cell addSubview:cellActivityIndicator];
where, here [cellActivityIndicator setCenter:CGPointMake(20, 20)];
you enter position indicator in cell.
and in cellForRowAtIndexPath
[cell setSelectionStyle:UITableViewCellSelectionStyleGray];
Upvotes: 4