मैंने एसओ सामान का लोड किया है और Apple के संदर्भों में, लेकिन फिर भी अपनी समस्या को प्रबंधित करने में असमर्थ हूं।
जो मेरे पास है:
- 2
UIImageViewएस और 2UIButtonएस के साथ एक स्क्रीन उनसे जुड़ी - एनीमेशन के 2 प्रकार:
- स्केलिंग और फिर प्रत्येक छवि के नीचे, एक के बाद एक, केवल एक बार में
viewDidLoad - जब एक बटन दबाया जाता है (प्रत्येक के अंदर एक कस्टम बटन छिपा होता है
UIImageView) तो यह उपयुक्त-UIImageViewएक के एनीमेशन को ट्रिगर करता है , न कि दोनों (साथ ही स्केल अप, फिर डाउन)। - जैसा कि मैं iOS4 के लिए लिख रहा हूं + मुझे ब्लॉक आधारित एनिमेशन का उपयोग करने के लिए कहा गया है!
- स्केलिंग और फिर प्रत्येक छवि के नीचे, एक के बाद एक, केवल एक बार में
क्या चाहिए मुझे:
मैं एक रनिंग एनीमेशन कैसे रद्द करूं? मैं आखिरकार रद्द करने में कामयाब रहा, लेकिन पिछले एक ...: /
यहाँ मेरा कोड स्निपेट है:
[UIImageView animateWithDuration:2.0
delay:0.1
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
isAnimating = YES;
self.bigLetter.transform = CGAffineTransformScale(self.bigLetter.transform, 2.0, 2.0);
} completion:^(BOOL finished){
if(! finished) return;
[UIImageView animateWithDuration:2.0
delay:0.0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
self.bigLetter.transform = CGAffineTransformScale(self.bigLetter.transform, 0.5, 0.5);
} completion:^(BOOL finished){
if(! finished) return;
[UIImageView animateWithDuration:2.0
delay:0.0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
self.smallLetter.transform = CGAffineTransformScale(self.smallLetter.transform, 2.0, 2.0);
} completion:^(BOOL finished){
if(! finished) return;
[UIImageView animateWithDuration:2.0
delay:0.0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
self.smallLetter.transform = CGAffineTransformScale(self.smallLetter.transform, 0.5, 0.5);
}
completion:^(BOOL finished){
if (!finished) return;
//block letter buttons
[self.bigLetterButton setUserInteractionEnabled:YES];
[self.smallLetterButton setUserInteractionEnabled:YES];
//NSLog(@"vieDidLoad animations finished");
}];
}];
}];
}];
किसी भी तरह से smallLetter UIImageViewठीक से काम नहीं कर रहा है, क्योंकि जब दबाया (बटन के माध्यम से) bigLetterएनिमेशन ठीक से रद्द कर रहा है ...
संपादित करें:
मैं इस समाधान का उपयोग किया है, लेकिन अभी भी नीचे स्केलिंग के साथ समस्या है smallLetter UIImageView- बिल्कुल भी रद्द नहीं कर रहा है ...
समाधान
EDIT2: मैंने इसे अगले / प्रचलित तरीकों की शुरुआत में जोड़ा है:
- (void)stopAnimation:(UIImageView*)source {
[UIView animateWithDuration:0.01
delay:0.0
options:(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionAllowUserInteraction)
animations:^ {
source.transform = CGAffineTransformIdentity;
}
completion:NULL
];
}
समस्या बनी रहती है ...: / कोई विचार नहीं है कि एनीमेशन श्रृंखला में अक्षरों के लिए अंतिम एनीमेशन को कैसे बाधित किया जाए