views:

193

answers:

2

How can we change the size of the text in a picker view?

Anyone please help.

A: 

See the answer to this question.

macatomy
+3  A: 

Hi, Sharreth

You can change the font size of UIPickerView using code :

 - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view {
            UILabel *retval = (id)view;
            if (!retval) {
                retval= [[[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [pickerView rowSizeForComponent:component].width, [pickerView rowSizeForComponent:component].height)] autorelease];
            }

            retval.font = [UIFont systemFontOfSize:22];

       return retval;
    }
yakub_moriss