ピッカービューのアニメーション速度を遅くして、スロット マシンの効果をシミュレートしたいと考えています。
のアニメーション速度を遅くするにはどうすればよいですか
[pickerView selectRow:601 inComponent:0 animated:YES];
また、スロット マシンのように、コンポーネント 0 がアニメーション化した後にコンポーネント 1 がアニメーション化するようにアニメーションをずらすにはどうすればよいでしょうか。
スピンをずらすために次のコードを試してみましたが、それらはすべて同時にスピンしているようです。
- (void) viewDidAppear:(BOOL)animated
{
[UIView beginAnimations:@"reel1" context:nil]; // nil = dummy
[UIPickerView setAnimationDelegate:self];
[UIPickerView setAnimationDidStopSelector:@selector(reelAnimationFinished:finished:context:)];
[reel selectRow:24 inComponent:0 animated:YES];
[UIView commitAnimations];
}
- (void) reelAnimationFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context {
if (animationID == @"reel1")
{
[UIView beginAnimations:@"reel2" context:nil]; // nil = dummy
[UIPickerView setAnimationDelegate:self];
[UIPickerView setAnimationDidStopSelector:@selector(reelAnimationFinished:finished:context:)];
[reel selectRow:26 inComponent:1 animated:YES];
[UIView commitAnimations];
}
else if (animationID == @"reel2")
{
[reel selectRow:29 inComponent:2 animated:YES];
}
}