可能是重复问题:
UIPickerView字体…
我在我的应用程序中遇到了一个困难的问题。我已经到处搜索了,但无济于事。如何更改UIPickerView中的字体大小?
可能是重复问题:
UIPickerView字体…
我在我的应用程序中遇到了一个困难的问题。我已经到处搜索了,但无济于事。如何更改UIPickerView中的字体大小?
在选择器(picker)的数据代理中实现viewForRow:forComponent:
方法,在其中创建一个UILabel实例,并使用所需的字体(以及所有其他属性),例如:
- (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);
PickerView.transform = CGAffineTransformMakeScale(0.4, 0.4);