タイマーとアニメーション ブロックを使用して画像ビューを移動しています。同時に、ユーザーはこれらのビュー (ボタン) のいくつかをクリックすると、さまざまな画像ビューの移動/サイズ変更/回転を開始するアニメーション ブロックがさらにいくつかあります。
ビューのアルファを変更し、ビューに新しい CGpoint を与えることは非常にうまく機能しますが、uiview.transform 関数でサイズ変更または回転を呼び出すと、すべてのビューが (ストーリーボードから) 開始位置にリセットされるようです。
アニメーション ブロック内でこの変換関数を使用できるようになりたいと思っていますが、このリセットをバイパスできない場合は、実際には実行可能なオプションではありません。
コード例:
- (void)moveGust:(NSTimer*) timer
{
if(centerCloud1.x >= 1100)
{
centerCloud1.x = -79;
gustOutlet.center = centerCloud1;
}
if(centerCloud2.x >= 1100)
{
centerCloud2.x = -79;
cloudOutlet.center = centerCloud2;
}
centerCloud1 = gustOutlet.center;
centerCloud1.x = round(centerCloud1.x+10);
centerCloud2 = cloudOutlet.center;
centerCloud2.x = round(centerCloud2.x+8);
[UIView animateWithDuration:2 delay:0 options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionCurveLinear animations:^(void){
gustOutlet.center = centerCloud1;
cloudOutlet.center = centerCloud2;
}completion:^(BOOL Finished){ }];
}
- (IBAction)signAction:(id)sender {
[UIView animateWithDuration:0 animations:^(void) {
signTop.transform = CGAffineTransformScale(signTop.transform, 1.1, 1.1);
}];
}
何か案は?ありがとう!