Try this:
#pragma mark - UIPickerViewDelegate
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
UILabel *label = (UILabel *)[self.yourPickerOutlet viewForRow:row forComponent:component];
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor blueColor];
}
#pragma mark PickerView DataSource
- (NSInteger)numberOfComponentsInPickerView:
(UIPickerView *)pickerView
{
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView
numberOfRowsInComponent:(NSInteger)component
{
return [dataSourseArray count];
}
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
NSString* itemString = dataSourseArray[row];
UILabel *label;
if(view==nil){
label = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 310, 30)];
label.textColor = [UIColor blackColor];
label.backgroundColor = [UIColor clearColor];
label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0,1);
label.textAlignment = NSTextAlignmentCenter;
}else{
label = (UILabel*) view;
}
label.text = itemString;
return label;
}