只是一个简单的问题。 是否可以通过动画更改UITextView的文本颜色?用动画改变UITextView的文字颜色
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.textColor = [UIColor grayColor];
[UITextView commitAnimations];
干杯!
- Martin
只是一个简单的问题。 是否可以通过动画更改UITextView的文本颜色?用动画改变UITextView的文字颜色
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.textColor = [UIColor grayColor];
[UITextView commitAnimations];
干杯!
- Martin
正如Martin Cote所说textColor不是一个动画属性。
我解决了这个问题,改为改为UItextView透明。
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.alpha = 0.5f;
[UITextView commitAnimations];
谢谢你的时间。
/马丁
textColor不是一个动画属性,所以我不认为这对UITextView是可行的。
由于iOS的4.0现在就可以做到这一点使用[UIView transitionWithView:duration:options:animations:completion:]
[UIView transitionWithView:textView
duration:0.5f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
textView.textColor = ...
}
completion:nil];