Android 我怎么能让文本每秒闪烁一次?
在我的应用程序中,我以“hh:mm a”的形式显示了时间。现在我想每秒钟闪烁一次Android 我怎么能让文本每秒闪烁一次?,android,Android,在我的应用程序中,我以“hh:mm a”的形式显示了时间。现在我想每秒钟闪烁一次:,如何?将:放在viewFlipper内的视图中,在showNext()和showPrevious()中设置闪烁效果。设置autoStart=true和不确定=true 您可以使用: TextView myText = (TextView) findViewById(R.id.myText ); Animation anim = new AlphaAnimation(0.0f, 1.0f); anim.se
:
,如何?将:
放在viewFlipper
内的视图中,在showNext()
和showPrevious()
中设置闪烁效果。设置autoStart=true
和不确定=true
您可以使用:
TextView myText = (TextView) findViewById(R.id.myText );
Animation anim = new AlphaAnimation(0.0f, 1.0f);
anim.setDuration(50); //You can manage the time of the blink with this parameter
anim.setStartOffset(20);
anim.setRepeatMode(Animation.REVERSE);
anim.setRepeatCount(Animation.INFINITE);
myTextview.startAnimation(anim);
实施倒计时,或者改变文本的颜色如果回答,解决你的问题点击“右”标记