我试图让一个按钮在发生特定事件时淡出,但是对按钮的更改不是即时的,而是等待对按钮执行的所有操作完成。是否有任何(希望是简单的)显示方式发生时对用户的更改?
代码:
featuredimage.setBackgroundDrawable(getResources().getDrawable(R.drawable.featuredimage_cc_movement1));
for (int alpha = 0; alpha < 255; alpha+=10) {
//Thread.sleep(1);
featuredimage.setAlpha(alpha);
featuredinfo.setAlpha(alpha);
}
featuredinfo.setText(Html.fromHtml("<center><big><b>FEATURED " + catagory + "</b></big></center><br>"
+ getFeatured().getMediumString()));
featuredimage.setBackgroundDrawable(getResources().getDrawable(R.drawable.featuredimage_gradient));
for (int alpha = 255; alpha > 0; alpha--) {
//Thread.sleep(1);
featuredimage.setAlpha(alpha);
featuredinfo.setAlpha(alpha);
}