标签:
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(nullable UIView *)view; { UILabel* pickerLabel = (UILabel*)view; if (!pickerLabel){ pickerLabel = [[UILabel alloc] init]; pickerLabel.font=[UIFont systemFontOfSize:18 weight:1]; pickerLabel.textColor=[UIColor whiteColor]; pickerLabel.textAlignment=1; [pickerLabel setBackgroundColor:[UIColor clearColor]]; } pickerLabel.text=[self pickerView:pickerView titleForRow:row forComponent:component]; //在该代理方法里添加以下两行代码删掉上下的黑线 [[pickerView.subviews objectAtIndex:1] setHidden:TRUE]; [[pickerView.subviews objectAtIndex:2] setHidden:TRUE]; return pickerLabel; }
标签:
原文地址:http://www.cnblogs.com/death3721/p/5194256.html