0

iOS で 2 つのアニメーションを実行すると問題が発生します。最初に、最初のアニメーション セットのフレームを変更して画像を画面の下部から上部に移動しようとしています。次に、スケールを変換してオブジェクトの長さを拡張しようとしています。しかし、何らかの理由で、最初のアニメーションが終了すると、オブジェクトは画面の下部にある元の場所に戻り、成長する変換が画面外で発生します。誰でもこれで私を助けることができますか?ご協力いただきありがとうございます。私のコードは次のとおりです。

CGRect fullview = CGRectMake(59, 102, 650, 150);
CGRect iconView = CGRectMake(59, 102, 290, 150);
CGRect textView = CGRectMake(349, 102, 360, 150);

[_profileBtn setEnabled:FALSE];
[_profileBtn setHidden:TRUE];
[UIView animateWithDuration:1 animations:^{  // animate the following:

    _profileIcon.frame = iconView; // move to new location
    _profileText.frame = textView; // move to new location
    _profileBackground.frame =fullview;

}completion:^(BOOL finished){
    [UIView animateWithDuration:1 animations:^{  // animate the following:           
        _profileBackground.transform = CGAffineTransformMakeScale(1, 5.64);
    }];


}];
4

2 に答える 2

0

私が望んでいたものに近い解決策を見つけました。これにより、翻訳と移動が同時に行われます。

    CGRect iconView = CGRectMake(59, 102, 290, 150);
    CGRect textView = CGRectMake(349, 102, 360, 150);
    _profileIcon.frame = iconView; // move to new location
    _profileText.frame = textView; // move to new location
    CGAffineTransform scale = CGAffineTransformMakeScale(1, 5.00);
    CGRect fullview = CGRectMake(59, 40, 650, 150);
    _profileBackground.frame = CGRectApplyAffineTransform(fullview,scale);
于 2013-06-21T22:30:52.453 に答える