是否可以为系统警报类型视图设置动画?如果是怎么回事?
我试过了,但没有用:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View view = new View(this);
view.setBackgroundColor(0x33FF0000);
Animation animation = AnimationUtils.loadAnimation(this, R.anim.blink);
view.startAnimation(animation);
WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(-1, -1, 2006, 1336, -3);
windowManager.addView(view, layoutParams);
}
眨眼.xml:
<alpha
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromAlpha="0.0"
android:toAlpha="1"
android:duration="500"
android:repeatMode="reverse"
android:repeatCount="9999999"/>
此代码将视图添加到系统,但它不是动画的。