UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, 200, 200)]; NSString *holderText = @"-------------"; NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:holderText]; [placeholderaddAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, holderText.length)]; [placeholderaddAttribute:NSFontAttributeName value:[UIFontboldSystemFontOfSize:16] range:NSMakeRange(0, holderText.length)]; textField.attributedPlaceholder = placeholder; [cell.contentViewaddSubview:textField];
TextFiled修改placeholder的颜色和字体大小
最新推荐文章于 2021-07-05 18:28:58 发布