मैं एक बहुत ही सरल कार्य से फंस गया हूं, मैं एक UIView एनीमेशन को आसानी से/आसानी से करना चाहता हूं लेकिन यह सही एनीमेशन विकल्प का उपयोग करने के बावजूद हमेशा रैखिक है।UIView एनीमेशन वक्र आसानी से काम नहीं कर रहा है
यहां कोड है जो सभी खातों द्वारा काम करना चाहिए, यह एक UIViewControllerAnimatedTransitioning क्लास में सेट है लेकिन मेरे पास पिछले कस्टम सेग्यू क्लास में एक ही समस्या है;
[UIView animateWithDuration:0.4f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^(void) {
self.dimView.alpha = 1.0;
self.imageView.frame = self.destinationRect;
} completion:^(BOOL finished) {
[self.imageView removeFromSuperview];
[self.dimView removeFromSuperview];
[transitionContext completeTransition:YES];
}];
हालांकि, निम्न कोड के साथ एक वसंत एनीमेशन काम करता है हालांकि मैं ऐसा नहीं करता।
[UIView animateWithDuration:0.8f delay:0 usingSpringWithDamping:0.7f initialSpringVelocity:2.0f options:UIViewAnimationOptionCurveEaseInOut animations:^(void) {
self.dimView.alpha = 1.0;
self.imageView.frame = self.destinationRect;
} completion:^(BOOL finished){
[self.imageView removeFromSuperview];
[self.dimView removeFromSuperview];
[transitionContext completeTransition:YES];
}];
मुझे सिम्युलेटर और आईपैड 2 परीक्षण डिवाइस पर एक ही व्यवहार मिल रहा है। क्या मैं कुछ गलत कर रहा हूं? क्या फ्रेम या अल्फा मान एनिमेट करने में कोई समस्या है?
धन्यवाद ssantos। पहले मैंने सोचा कि यह चाल है लेकिन मेरी आंखें मुझे बेवकूफ़ बना रही थीं। अभी भी निश्चित रूप से रैखिक। बहुत अजीब और कष्टप्रद। –
एमएमएच वास्तव में अजीब, अंतर को ध्यान में रखने के लिए दूरी बहुत छोटी हो सकती है? मैं सिर्फ 'एनीमेशन' के साथ 'बड़ी' एनीमेशन की कोशिश करता हूं। – ssantos