知道textField背景颜色是否为默认颜色

时间:2012-12-24 20:25:31

标签: ios uitextfield uicolor

我想比较UITextField的背景颜色是否为默认颜色。

类似的东西:

if ([blankField.backgroundColor isEqual:nil] 
       && [colorField.backgroundColor isEqual:nil])
{
}

1 个答案:

答案 0 :(得分:0)

您可以尝试对每个文本字段的一部分进行采样,并判断它们是否彼此相同。请看这个链接:How does one compare one image to another to see if they are similar by a certain percentage, on the iPhone?此链接讨论如何比较两个图像以查看它们是否相似。希望这会有所帮助。