答案 0 :(得分:2)
有一个第三方库,您可以通过它来执行此操作https://github.com/Rizh/RCounter https://github.com/naked-apps/NACounter https://github.com/jonathantribouharet/JTNumberScrollAnimatedView
答案 1 :(得分:0)
iOS中最接近的东西,就是UIPickerView。您可以在Interface Builder中或通过代码创建UIPickerView。
接下来,让您的课程符合UIPickerViewDataSource
和UIPickerViewDelegate
。
在viewDidLoad:
方法中,将UIPickerView
的委托和dataSource分配给相应的类。
最后将以下方法添加到您的班级。
// The number of columns of data
- (int)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 5;
}
// The number of rows of data
- (int)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return 10;
}
// The data to return for the row and component (column) that's being passed in
- (NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
return [NSString stringWithFormat:@"%ul",row];
}