美文网首页
UITextField的PlaceHolder居中显示

UITextField的PlaceHolder居中显示

作者: sun_glory | 来源:发表于2017-11-28 20:00 被阅读0次

UITextField的PlaceHolder居中显示,可以直接访问到UITextField的placeholderLabel进行操作:

UILabel * placeholderLabel = [self.searchTextField valueForKey:@"_placeholderLabel"];

placeholderLabel.textAlignment = NSTextAlignmentCenter;

placeholderLabel.textColor = [UIColor redColor];

placeholderLabel.font = [UIFont systemFontOfSize:16];

相关文章

网友评论

      本文标题:UITextField的PlaceHolder居中显示

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