您的位置:首页 > 其它

设置textfield的placeholder的字体和颜色

2015-07-31 13:24 471 查看
设置textfield的placeholder的字体和颜色
UITextField *textField = [[UITextField
alloc] initWithFrame:CGRectMake(10,
30, 300,
150)];

textField.placeholder =
@"this is a textField";

[textField setValue:[UIColor
redColor]
forKeyPath:@"_placeholderLabel.textColor"];

[textField setValue:[UIFont
boldSystemFontOfSize:30]
forKeyPath:@"_placeholderLabel.font"];

textField.borderStyle =
UITextBorderStyleRoundedRect;
[self.view
addSubview:textField];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: