在iOS 5上显示单元格上的复选标记 [英] Displaying checkmark on cells iOS 5

查看:88
本文介绍了在iOS 5上显示单元格上的复选标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个基本的核对清单应用程序,并希望知道如何在单元格触摸后将其显示为一个简单的复选标记。到目前为止,我还没有使用任何编码,并且在故事板上做了所有事情。我有一个包含10个单元格的视图。每个细胞都是一个任务。我想在点击每个单元格时显示一个复选标记。我知道一些基本的目标 - 但我没有进步。

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.

推荐答案

线索在表格单元格的附件中,您应该使用类似

the clue is within the accessory of a table cell, you should use something like

cell.accessoryType = myCheckBoolean ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;

因此,您应该使用tableview并根据选择事件或现有代码中的任何其他内容设置处理并使用上面的代码片段来显示复选标记。 (图片无法发布)

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)

这篇关于在iOS 5上显示单元格上的复选标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆