Objective-C:textfields占位符文本的实际颜色是什么?

时间:2016-01-22 11:59:45

标签: objective-c xcode colors placeholder

我试过弄乱红色,绿色,蓝色的个别值。但似乎无法获得正确的颜色。

e.g

[UIColor colorWithRed:0.80 green:0.80 blue:0.80 alpha:1.0];

由于

修改

感谢Satish A让我朝着正确的方向前进。

我得到的UITextField.placeholder的UIColor是

[UIColor colorWithRed:196.0/255.0 green:193.0/255.0 blue:110.0/255.0 alpha:1.0]

1 个答案:

答案 0 :(得分:0)

尝试以下:

覆盖result[0] = Person = ? result[1] = Name = ? result[2] = (Country = ? OR City = 1) ,以便手动呈现占位符文本:

drawPlaceholderInRect:(CGRect)rect

OR

- (void) drawPlaceholderInRect:(CGRect)rect {
    [[UIColor blueColor] setFill];
    [[self placeholder] drawInRect:rect withFont:[UIFont systemFontOfSize:16]];
}