UIPickView 设置分割线颜色 文字颜色

- (UIView*)pickerView:(UIPickerView*)pickerView viewForRow:(NSInteger)row

forComponent:(NSInteger)component reusingView:(UIView*)view

{

//设置分割线的颜色

for(UIView*singleLineinpickerView.subviews)

{

if(singleLine.frame.size.height<1)

{

singleLine.backgroundColor=kSingleLineColor;

}

}

//设置文字的属性

UILabel*genderLabel = [UILabelnew];

genderLabel.textAlignment=NSTextAlignmentCenter;

genderLabel.text=self.genderArray[row];//self.genderArray里边内容为@[@"男",@"女"]

genderLabel.textColor=kSpecialTextColor;

returngenderLabel;

}

你可能感兴趣的:(UIPickView 设置分割线颜色 文字颜色)