标签:gre init ntc 方法 问题解决 nec index ini 题解
这个问题很容易解决,需要在pickerview的代理方法中设置上下横线的颜色就可以了
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel *label = [[UILabel alloc] init]; label.frame = CGRectMake(0, 0, _picker.frame.size.width, 32); label.font = [UIFont systemFontOfSize:22]; if (component == 0) { label.text = self.yearArray[row]; }else if (component == 1) { label.text = self.monthArray[row]; }else if (component == 2) { label.text = self.dayArray[row]; } label.textAlignment = NSTextAlignmentCenter; // 设置横线的颜色,实现显示或者隐藏 ((UILabel *)[_picker.subviews objectAtIndex:1]).backgroundColor = FINELINECOLOR; ((UILabel *)[_picker.subviews objectAtIndex:2]).backgroundColor = FINELINECOLOR; return label; }
iOS UIPickerView 可能会出现选中行不显示或者去掉上下两条横线的问题解决,
标签:gre init ntc 方法 问题解决 nec index ini 题解
原文地址:http://www.cnblogs.com/weipeng168/p/6269666.html