美文网首页
iOS 改变UITextField中光标颜色,placehold

iOS 改变UITextField中光标颜色,placehold

作者: 大眠兽 | 来源:发表于2016-08-26 18:16 被阅读0次

修改光标的颜色,直接修改tintColor就好了。

[[UITextField appearance] setTintColor:[UIColor blackColor]];

或者直接在XIB上修改,都可以有效。

修改placeholder颜色

self.mobileTF.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.mobileTF.placeholder attributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];

相关文章

网友评论

      本文标题:iOS 改变UITextField中光标颜色,placehold

      本文链接:https://www.haomeiwen.com/subject/raezsttx.html