UIPicker 特定列和行的字体大小
我正在寻找更改 UIPicker 中特定列和行的字体大小。基本上,视图中的文本太多,我想调整第二列中特定行的大小,以便它适合?
感谢您的帮助。
I'm looking to change the font size of a certain column and row in a UIPicker. Basically there's too much text that runs off the view and I'd like to size just that particular row in the 2nd column down so it fits?
thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要自定义标签字体大小,请实现名为的委托方法:
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view;< /code>
返回配置良好的
UILabel
(您可以更改font
属性或设置将FontSizeToFitWidth
属性调整为YES
)。If you want to customize label font size, implement delegate method called :
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view;
to return a well configured
UILabel
(you can changefont
property or setadjustsFontSizeToFitWidth
property toYES
).