Does anyone know how to change the color of a row (or row background) in the UIPickerView control from the iPhone SDK? Similiar to the below title for row, however I would also
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
UILabel *labelSelected = (UILabel*)[pickerView viewForRow:row forComponent:component];
[labelSelected setTextColor:[UIColor redColor]];
}
And
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
UILabel *label = (id)view;
if (!label){
label=[[UILabel alloc]init];
label.textAlignment = NSTextAlignmentCenter;
pickerView.backgroundColor=[UIColor whiteColor];
label.text=[self pickerView:pickerView titleForRow:row forComponent:component];
label.textColor=[UIColor grayColor];
}
return label;
}