2012-01-24 7 views
9

मैं एक समारोह चल रहा हूँ एक नाटक आइकन पल्स के लिए:एनिमेट विथ अवधि: देरी: विकल्प: एनिमेशन: समापन: UIViewAnimationOptionRepeat के साथ उपयोग किए जाने पर UI को अवरुद्ध करना | UIViewAnimationOptionAutoreverse

- (void)pulsePlayIcon { 
    if ([self isPlaying]) { 
     return; 
    } 

    [[self videoView] playIcon].hidden = NO; 
    [[self videoView] playIcon].alpha = 1.0; 

    [UIView animateWithDuration:[self playIconPulseDuration] 
          delay:[self playIconPulseTimeInterval] 
         options:(UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse) 
        animations:^{ 
         [[self videoView] playIcon].alpha = 0.8; 
        } 
        completion:^(BOOL completed) {}]; 
} 

यह आईओएस 5.0 में शानदार काम करता है, लेकिन 4.3 में यह ब्लॉक यूआई। यूआई जवाब नहीं देता है। मैंने पढ़ा कि यह आईओएस संस्करण 4.0 या अधिक (> = 4.0) में दोहराने वाले एनिमेशन करने का सुझाया गया तरीका था। अपराधी UIViewAnimationOptionRepeat प्रतीत होता है। क्या आप कोई स्पष्ट त्रुटियां देख रहे हैं जो मैं कर रहा हूं?

+0

मैं बस इसी सटीक समस्या में आया था। मैं आज तक आईओएस 4.3 पर परीक्षण नहीं किया था। किसी कारण से, ऐसा लगता है कि UIViewAnimationOptionAllowUserInteraction आईओएस 5 और उसके बाद के लिए सच है। – jowie

उत्तर

11

आपको शायद UIViewAnimationOptionAllowUserInteraction भी शामिल होना चाहिए।

+0

बिल्कुल सही। धन्यवाद। – schellsan