如何将UIColor值转换为命名的颜色字符串? [英] How to convert UIColor value to a named color string?

查看:104
本文介绍了如何将UIColor值转换为命名的颜色字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将 UIColor 转换为颜色名称的 NSString

I need to convert UIColor to an NSString of the color name.

我试过:

 NSString *colorString = NSStringFromClass([[UIColor redColor] class]); 

colorString

推荐答案

你想做什么?查看通用 -desciption 方法开始

What do you want to do that for? Have a look at generic -desciption method for a start

UIColor* someColor = ...//Initialize color
NSString* colorString = [someColor description];

这篇关于如何将UIColor值转换为命名的颜色字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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