开发者

How to change the font size in a UIPickerView? [duplicate]

This question already has answers here: 开发者_开发技巧 Closed 11 years ago.

Possible Duplicate:

UIPickerView Font…

I'm really stuck on this one problem in my application. I searched everywhere to no avail. How can I change the font size in a UIPickerView?


Implement viewForRow:forComponent: method in picker's data delegate, create UILabel instance in it with the font (and all other properties) you need, e.g.:

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
    UILabel* tView = (UILabel*)view;
    if (!tView){
        tView = [[UILabel alloc] init];
            // Setup label properties - frame, font, colors etc
            ...
    }
    // Fill the label text here
    ...
    return tView;
}


PickerView.transform = CGAffineTransformMakeScale(0.4, 0.4);

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜