2010-04-29 20 views
5

के साथ UITextView टेक्स्ट रंग बदलें बस एक साधारण सवाल है। क्या एनीमेशन के साथ UITextView के टेक्स्ट रंग को बदलना संभव है?एनीमेशन

[UITextView beginAnimations:nil context:NULL]; 
[UITextView setAnimationDuration:2.0]; 
    textView.textColor = [UIColor grayColor]; 
[UITextView commitAnimations]; 

चीयर्स!
- मार्टिन

उत्तर

4

मार्टिन कोटे ने कहा कि पाठक एक एनिमेटेबल संपत्ति नहीं है।
मैंने इसे UItext में बदलाव के साथ हल किया इसके बजाय पारदर्शिता देखें।

[UITextView beginAnimations:nil context:NULL]; 
[UITextView setAnimationDuration:2.0]; 
    textView.alpha = 0.5f; 
[UITextView commitAnimations]; 

आपके समय के लिए धन्यवाद।
/मार्टिन

6

टेक्स्टकॉलर एक एनिमेटेबल संपत्ति नहीं है, इसलिए मुझे नहीं लगता कि यह UITextView के साथ व्यवहार्य होगा।

9

iOS 4.0 के बाद से अब आप इस का उपयोग कर प्राप्त कर सकते हैं [UIView transitionWithView:duration:options:animations:completion:]

[UIView transitionWithView:textView 
        duration:0.5f 
        options:UIViewAnimationOptionTransitionCrossDissolve 
       animations:^{ 
        textView.textColor = ... 
       } 
       completion:nil];