Accessing cell attributes outside of cellForRowAtIndexPath

后端 未结 5 1313
既然无缘
既然无缘 2021-01-18 09:56

I have five fields setup on a Signup controller. Username, displayname, password, confirm password and email address.

They are setup with the following:



        
5条回答
  •  攒了一身酷
    2021-01-18 10:27

    you can get UITableViewCell using NSIndexPath.

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:YOUR_ROW inSection:YOUR_SECTION];
    
    UITableViewCell* cell = [yourTable cellForRowAtIndexPath:indexPath];
    cell.textLabel.textColor = YOUR_COLOR;
    [yourTable reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
    

    Hope it helps you.

提交回复
热议问题