使用动画更改 UITextView 文本颜色
只是一个简单的问题。 是否可以用动画更改 UITextView 的文本颜色?
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.textColor = [UIColor grayColor];
[UITextView commitAnimations];
干杯!
- 马丁
Just a simple question.
Is it possible to change the text color of UITextView with a animation?
[UITextView beginAnimations:nil context:NULL];
[UITextView setAnimationDuration:2.0];
textView.textColor = [UIColor grayColor];
[UITextView commitAnimations];
Cheers!
- Martin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从 iOS 4.0 开始,您现在可以使用
[UIViewtransitionWithView:duration:options:animations:completion:]
来实现此目的Since iOS 4.0 you can now achieve this using
[UIView transitionWithView:duration:options:animations:completion:]
textColor 不是一个可动画的属性,所以我认为这对于 UITextView 来说是不可行的。
The textColor is not an animatable property, so I don't think this will be feasible with the UITextView.
正如 Martin Cote 所说,textColor 不是一个可设置动画的属性。
我通过更改 UItextView 透明度解决了这个问题。
感谢您抽出时间。
/ 马丁
As Martin Cote said textColor is not an animatable property.
I solved this with a change to the UItextView transparency instead.
Thanks for your time.
/ martin