UIPickerView 设计每行的大小
- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component
{
return 80.0;
}
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *myView = nil;
myView = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 180, 30)];
for (int i = 0; i < self.dataSource.count; ++i) {
if (i == component) {
myView.text = self.dataSource[i][row];
}
}
myView.textAlignment = NSTextAlignmentCenter;
myView.font = [UIFont systemFontOfSize:HKL_ScreenWidth * .04];
myView.backgroundColor = [UIColor clearColor];
return myView;
}