How do i hide the Separator in my Picker View.Here is the screenshot .
Here is the code for my custom UIPickerView.
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
UILabel *label=[[UILabel alloc]init];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.textAlignment=NSTextAlignmentCenter;
switch (component) {
case 0:
label.text=[_hourArray objectAtIndex:row];
label.font = [UIFont fontWithName:@"MYRIADPRO-REGULAR" size:70];
break;
case 1:
label.text=[_minutesArray objectAtIndex:row];
label.font = [UIFont fontWithName:@"MYRIADPRO-REGULAR" size:70];
break;
case 2:
label.text=[_ampmArray objectAtIndex:row];
label.font = [UIFont fontWithName:@"MYRIADPRO-REGULAR" size:15];
break;
default:
break;
}
return label;
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 3;
}
Please Help me out.Thanks
To hide the selection indicator for a UIPickerView:
_pickerView.showsSelectionIndicator = FALSE;
You can make it in code (as above) or in Interface Builder:
Edit
According to Apple documentation:
On iOS 7 and later you cannot customzie the picker view’s selection indicator. The selection indicator is always shown, so setting this property to NO has no effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With