How to change font size in UIPickerView?

Possible duplicate:
UIPickerView Font ...

I am really stuck with this problem in my application. I searched everywhere to no avail. How to change font size in UIPickerView?

+3
source share
2 answers

Inject the method viewForRow:forComponent:into the collector data delegate, create an instance of UILabel with the font (and all other properties) in it, for example:

- (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;
}
+15
source

PickerView.transform = CGAffineTransformMakeScale (0.4, 0.4);

-1
source

All Articles