ios设置textField的placeholder的字体颜色、大小

来源:互联网 发布:淘宝宝贝照片大小 编辑:程序博客网 时间:2024/05/13 20:23



代码片段:

<span style="font-size:14px;color:#333333;">    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 300, 40)];    textField.placeholder = @"username is in here!";    [textField setValue:[UIColor greenColor] forKeyPath:@"_placeholderLabel.textColor"];    [textField setValue:[UIFont boldSystemFontOfSize:11] forKeyPath:@"_placeholderLabel.font"];    [self.view addSubview:textField];</span>



0 0
原创粉丝点击