【发布时间】:2012-01-09 23:40:03
【问题描述】:
我正在设置UIBarButtonItem 的tintColor。只要颜色是明亮的颜色,这就会起作用,只要我尝试将其设置为 darkGrayColor 什么都没有发生,实际上它会将色调更改为白色!但是,如果我将颜色更改为redColor,那么它就可以工作了……这是怎么回事?
UIBarButtonItem *penButton = [_toolBar.items objectAtIndex:3];
UIBarButtonItem *crossButton = [_toolBar.items objectAtIndex:4];
//This actually sets the tint to white not gray, which is odd?
[penButton setTintColor:[UIColor darkGrayColor]];
[crossButton setTintColor:[UIColor redColor]]; //Red is fine, as is green etc
【问题讨论】:
-
您是否尝试过提供自定义颜色(RGB 值)并检查结果?
-
好主意,但这似乎也不起作用,我会用结果更新问题
-
设置色调颜色无效,但设置新的 alpha 有效!!
-
设置整个
UIBarButtonItem或随 tint 颜色提供的颜色值的新 alpha?无论如何,我建议您创建一个错误报告,因为这些限制似乎没有记录在案。请随时通知我们。
标签: iphone objective-c uikit uibarbuttonitem