开发者

How do I add a checkmark to a table view?

开发者 https://www.devze.com 2023-01-03 02:44 出处:网络
I\'ve put in this code: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

I've put in this code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

     UITableViewCell * tableCell = [self.tableView cellForRowAtIndexPath:indexPath];

     tableCell.accessoryType = UITableViewCellAccessoryCheckmark;
     [tableView deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:YES];

}
开发者_如何学C

But for some reason, the checkmark doesn't appear. Could someone help?


Actaully, I figured it out, that's the right way to do it, its just it had a black bg so it was hard to see.

0

精彩评论

暂无评论...
验证码 换一张
取 消