对于我的 uipickerview,我有:
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
CGSize size = [pickerView rowSizeForComponent:0];
UILabel *labelMain = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
labelMain.backgroundColor = [UIColor clearColor];
labelMain.font = [UIFont fontWithName:kFontSegoeSemiBold size:14];
labelMain.textColor = kColor_default_orangeText;
labelMain.textAlignment = NSTextAlignmentCenter;
int age;
// from
if (pickerView == self.pickerFrom) {
age = minAge + row;
}
// to
else {
age = minAge_pickerTo + row;
}
labelMain.text = [NSString stringWithFormat:@"%d", age];
return labelMain;
}
我知道如何制作蓝色选择指示器(我将蓝色视图放在 uipickerview 后面并将标签背景颜色设置为 clearColor。
我需要这个选择器(从/到年龄选择器)(蓝色垂直线仅用于 Photoshop):
现在我已经创建了这个选择器:
我有1个问题:
我想在选择指示器(或选择器视图的中心)的区域中使用白色文本颜色,在选择器视图的其他区域中使用橙色文本颜色。可能吗?