I created a decimal number UIPickerView
. I want the second component which is just a constant dot string (.) became as a separator, I mean :
1) It doesn't move
2) Its width is smaller than other components
3) Its color is different in comparison with other components
Here is the code:
#pragma mark - UIPickerView : Datasource Protocol
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 3;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { if(component == 2)
return 10;
if(component == 1)
return 1;
else
return 1000;
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
if(component == 1)
return @".";
else
return [NSString stringWithFormat:@"%ld", (long)row];
}
How can I do this?