更改UITableView中选中标记的颜色 [英] Change color on checkmark in UITableView

查看:80
本文介绍了更改UITableView中选中标记的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我如何更改UITableView中选中标记的颜色吗?

Could someone be so kind to show me how to change the color on the checkmark in UITableView?

我已经搜索过,但似乎无法正常工作.

I have searched but don't seem to get it to work.

欢呼

推荐答案

Apple没有提供更改选中标记颜色的公共方法,因此您必须使用图像来完成此操作.

Apple doesn't provide a public way to change the color of the checkmark so you'll have to do it with an image.

这非常简单,只需将单元格的accesoryView属性设置为包含正确颜色的选中标记的UIImageView.

This is very simple, just set the accesoryView property of the cell to a UIImageView containing a checkmark of the correct color.

它看起来像这样:

UIImageView *checkmark = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"coloredCheckmark.png"]];
cell.accessoryView = checkmark;
[checkmark release];

享受!

这篇关于更改UITableView中选中标记的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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