UIPickerView 修改里面的字体大小

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *myView = nil;      
if (component == 0) {
myView = [[[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 100, 30)] autorelease];
myView.textAlignment = UITextAlignmentCenter;
myView.text = [pickerNameArray objectAtIndex:row];
myView.font = [UIFont systemFontOfSize:14];         //用label来设置字体大小
myView.backgroundColor = [UIColor clearColor];
}else {
myView = [[[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 180, 30)] autorelease];
myView.text = [pickerPlaceArray objectAtIndex:row];
myView.textAlignment = UITextAlignmentCenter;
myView.font = [UIFont systemFontOfSize:14];
myView.backgroundColor = [UIColor clearColor];
}
return myView;
}
posted @ 2014-05-15 14:45  夜深人未静  阅读(2216)  评论(0编辑  收藏  举报