开发者

How to change font size in a pickerview?

开发者 https://www.devze.com 2022-12-25 04:05 出处:网络
I\'m fairly new to iPhone programming and am trying to implement a double-component PickerView. At this point the picker works fine in terms of taking user input, created with Interface Builder. Howev

I'm fairly new to iPhone programming and am trying to implement a double-component PickerView. At this point the picker works fine in terms of taking user input, created with Interface Builder. However, I need to change the font size to accommodate the text length in each column. I very much would appreciate any link to a straightforward method to creating a multi-component picke开发者_运维知识库r with an adjustable font size. Seems like it is not possible if Interface Builder is used to create the picker. So far I have not found any code links that address this issue in detail.

Thanks in advance.


You need to implement the delegate method...

pickerView:viewForRow:forComponent:reusingView:

... and then alter the font of the UI element inside the provided view. I think the default is a UILabel. Alternatively, you can provide your own custom view.

0

精彩评论

暂无评论...
验证码 换一张
取 消