简体   繁体   English

在UIContextualAction中正确设置彩色图标

[英]Set properly a colored icon in UIContextualAction

I am using a TableView to list some images with descriptions. 我正在使用TableView列出一些带有描述的图像。 Additionally this images needs to be shared and deleted and theirfore I am using UIContextualAction . 此外,这些图像需要共享和删除,因此我们正在使用UIContextualAction To the object I set the image for deleting like this: 对于我设置要删除的图像的对象,如下所示:

deleteAction.image = UIImage(named: "delete")

Unfortunately in runtime I can see my image is colored white, but I need it grey. 不幸的是,在运行时我可以看到我的图像是白色的,但是我需要它是灰色的。 Why is this behaviour? 为什么会这样?

Try this, i think it will help. 试试这个,我认为这会有所帮助。
在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM