I have a problem related to scrolling multiple components of UIPickerView. I created uipickerview with two components but when i scroll one of them, other also scroll but after part of second.
Code :
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
return 2;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
return [finalArray count];
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
if (component == 0) {
return [[finalArray objectAtIndex:row] objectForKey:@"value1"];
}else if (component == 1){
return [[finalArray objectAtIndex:row] objectForKey:@"value2"];
}else{
return nil;
}
- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
[thePickerView selectRow:row inComponent:0 animated:NO];
[thePickerView selectRow:row inComponent:1 animated:NO];
}
What i want is scrolling any components should scroll all together just like it is only one. It should not show even part of second for auto scrolling.
If it is possible, what do you recommend to do?...