Iphone UIPickerView按顺序选择多个组件中的行(一个接一个)
我使用以下方法(SPIN)在multi-cols-pickerview中选择7个值(取自数组)Iphone UIPickerView按顺序选择多个组件中的行(一个接一个),iphone,objective-c,cocoa-touch,performance,Iphone,Objective C,Cocoa Touch,Performance,我使用以下方法(SPIN)在multi-cols-pickerview中选择7个值(取自数组) for(int i = 0; i < 7; i++) { int newValue; newValue = [[array objectAtIndex:i] intValue]; [picker selectRow:newValue inComponent:i animated:YES]; [picker reloadComponent:i]; } for(int
for(int i = 0; i < 7; i++) {
int newValue;
newValue = [[array objectAtIndex:i] intValue];
[picker selectRow:newValue inComponent:i animated:YES];
[picker reloadComponent:i];
}
for(int i=0;i<7;i++){
int新值;
newValue=[[array objectAtIndex:i]intValue];
[picker selectRow:newValue不完整项:i动画:是];
[选择器重新加载组件:i];
}
这里的问题是,虽然它在模拟器上工作得很好,但在iphone上,动画并不平滑,而如果我只选择一个元素,一切都正常
所以我想一次选择一个组件
有人能帮忙吗
谢谢你的电脑比iPhone快得多,所以动画在模拟器中会很流畅,但如果你不小心,它会在iPhone上发出嘎嘎声 设置组件后,尝试重新加载组件,这样会更平滑一些:
for(int i = 0; i < 7; i++) {
int newValue;
newValue = [[array objectAtIndex:i] intValue];
[picker selectRow:newValue inComponent:i animated:YES];
}
[picker reloadAllComponents];
for(int i=0;i<7;i++){
int新值;
newValue=[[array objectAtIndex:i]intValue];
[picker selectRow:newValue不完整项:i动画:是];
}
[选择器重新加载所有组件];