特定列和行的 UIPicker 字体大小 [英] UIPicker font size for a certain column and row

查看:32
本文介绍了特定列和行的 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?

感谢您的帮助.

推荐答案

如果要自定义标签字体大小,请实现调用的委托方法:

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;

返回一个配置良好的UILabel(您可以更改font 属性或将adjustsFontSizeToFitWidth 属性设置为YES).

to return a well configured UILabel (you can change font property or set adjustsFontSizeToFitWidth property to YES).

这篇关于特定列和行的 UIPicker 字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆