问题
I am creating a basic checklist app and would like to know how to make a cell display a simple checkmark once it is touched. I have used no coding up to this point and have done everything in storyboarding. I have a single view that contains 10 cells. Each cell is a "task". I would like to display a checkmark on each cell as it is clicked. I know some basic objective-c but am not advanced.
回答1:
the clue is within the accessory of a table cell, you should use something like
cell.accessoryType = myCheckBoolean ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
So you should use a tableview and setup your handling according to selection events or anything else in your existing code and use the above snippet to display the check mark. (Image could not be posted)
来源:https://stackoverflow.com/questions/9449568/displaying-checkmark-on-cells-ios-5