Displaying checkmark on cells iOS 5

ぃ、小莉子 提交于 2019-12-24 15:33:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!