f0r*_*0rz 5 iphone animation uitextview
只是一个简单的问题.是否可以用动画更改UITextView的文本颜色?
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.textColor = [UIColor grayColor];
[UITextView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
干杯!
- 马丁
Jam*_*mes 10
从iOS 4.0开始,您现在可以实现此目的 [UIView transitionWithView:duration:options:animations:completion:]
[UIView transitionWithView:textView
duration:0.5f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
textView.textColor = ...
}
completion:nil];
Run Code Online (Sandbox Code Playgroud)
正如 Martin Cote 所说,textColor 不是一个可设置动画的属性。
我通过更改 UItextView 透明度解决了这个问题。
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.alpha = 0.5f;
[UITextView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
谢谢你的时间。
/ 马丁