简体   繁体   English

在计时器上调用视图方法?

[英]Calling view method on timer?

I have setup a view and I want to cycle the color of some text on that view using a timer. 我已经建立了一个视图,我想使用计时器来循环显示该视图上某些文本的颜色。 Is there a timer method for a view that gets called (or I can setup to get called) on a regular basis? 是否有用于定期调用(或可以设置调用)的视图的计时器方法?

NSTimer will work for you as long as you don't require "fine" precision -- like sub-100ms. 只要您不需要“精细”精度(如100ms以下), NSTimer就会为您工作。

Core Animation may work here as well. 核心动画也可以在这里工作。 Are you animating a UILabel or are you rendering the text directly into the view with Core Graphics calls (or OpenGL)? 您是要对UILabel进行动画处理,还是要通过Core Graphics调用(或OpenGL)将文本直接呈现到视图中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM