here is a Solution to get the same effect :
just manipulate your picker view delegate methods like this...
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSUInteger)row forComponent:(NSUInteger)component; {
NSMutableArray *strings = [NSMutableArray arrayWithCapacity:10];
[strings addObject:@"Zero"];
[strings addObject:@"One"];
[strings addObject:@"Two"];
[strings addObject:@"Three"];
[strings addObject:@"Four"];
[strings addObject:@"Five"];
[strings addObject:@"Six"];
[strings addObject:@"Seven"];
[strings addObject:@"Eight"];
[strings addObject:@"Nine"];
return [strings objectAtIndex:(row%10)];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSUInteger)row inComponent:(NSUInteger)component {
[self pickerViewLoaded:nil];
}
- (NSUInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSUInteger)component {
return 16384;
}
-(void)pickerViewLoaded: (id)blah {
NSUInteger max = 16384;
NSUInteger base10 = (max/2)-(max/2)%10;
[myPickerView selectRow:[myPickerView selectedRowInComponent:0]%10+base10 inComponent:0 animated:false];
}
- (NSUInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1;
}
to get the Source Code, click here.
No comments:
Post a Comment