iOS7 - 如何将这两个uipckers中心化?

时间:2013-11-25 00:52:43

标签: ios7 uipickerview

我经历了this answer和其他人。我似乎无法将这些专栏放在中心位置。

enter image description here

这是我的代码:

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
    NSLog(@"%s", __FUNCTION__);
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 120.0, 44.01)];
    label.backgroundColor = [UIColor clearColor];
    label.textColor = [UIColor whiteColor];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:18];
    label.text = [NSString stringWithFormat:@" %d", row+1];
    return label;    
}

任何想法我做错了什么?

使用IB属性检查器更新:

enter image description here

0 个答案:

没有答案