android字体闪烁动画(线程)
2013-10-21 21:01
309 查看
IT程序员开发必备-各类资源下载清单,史上最全IT资源,个人收藏总结!
android字体闪烁动画,使用线程和Timer实现[java] view
plaincopyprint?
public class ActivityMain extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
spark();
}
private int clo = 0;
public void spark() {
final TextView touchScreen = (TextView) findViewById(R.id.TextView01);// 获取页面textview对象
Timer timer = new Timer();
TimerTask taskcc = new TimerTask(){
public void run() {
runOnUiThread(new Runnable() {
public void run() {
if (clo == 0) {
clo = 1;
touchScreen.setTextColor(Color.TRANSPARENT); // 透明
} else {
if (clo == 1) {
clo = 2;
touchScreen.setTextColor(Color.RED);
} else {
clo = 0;
touchScreen.setTextColor(Color.GREEN);
}
}
}
});
}
};
timer.schedule(taskcc, 1, 300); // 参数分别是delay(多长时间后执行),duration(执行间隔)
}
}
相关文章推荐
- android字体闪烁动画(线程)
- Android字体闪烁动画(线程)
- android字体闪烁动画(线程)
- android字体闪烁动画(线程)
- android字体闪烁动画(线程)
- android字体闪烁动画(线程)
- android字体闪烁动画(线程)
- android实现字体闪烁动画的方法
- Android 中通过Canvas 与线程结合实现动画效果
- Android字体多样式和动画TextDrawable
- 剖析Android动画(图片闪烁、左右摇摆、上下晃动等效果)
- Android动画(图片闪烁、左右摇摆、上下晃动等效果)
- android图片闪烁或帧动画
- Android利用画图类和线程画出闪烁心形
- Android中利用画图类和线程画出闪烁的心形
- Android中利用画图类和线程画出闪烁的心形,送给亲爱的他(她) 推荐
- 剖析Android动画(图片闪烁、左右摇摆、上下晃动等效果)
- Android中利用画图类和线程画出闪烁的心形
- android动画实例之(图片闪烁、左右摇摆、上下晃动等效果)
- 实现android启动界面字体的动画效果