UIText字段占位符字体大小

UIText字段占位符字体大小

本文介绍了iOS UIText字段占位符字体大小/样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道您可以在UITextField中设置占位符的字体大小的方法吗?

Anybody know of a way you can set the font size for a Placeholder in a UITextField?

感谢您的帮助

推荐答案

您可以通过编程设置键@"_ placeholderLabel.font"的值来做到这一点

You can do it by programmatically setting up the value for the key @"_placeholderLabel.font"

[self.input setValue:[UIFont fontWithName: @"American Typewriter Bold" size: 20] forKeyPath:@"_placeholderLabel.font"];

[self.input setValue:[UIFont fontWithName: @"American Typewriter Bold" size: 20] forKeyPath:@"_placeholderLabel.font"];

这篇关于iOS UIText字段占位符字体大小/样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 11:32