我想以编程方式关闭带动画的slidingDrawer。我有以下代码:
SliderAnimationDown = new TranslateAnimation(0, 0, Animation.RELATIVE_TO_SELF, sliderHeight - handleHeight);
SliderAnimationDown.setDuration(1000);
SliderAnimationDown.setAnimationListener(new AnimationListener(
{
public void onAnimationEnd(Animation animation)
{
slide.close();
}
});
slide.startAnimation(SliderAnimationDown);
它正常工作,但你可以看到闪烁(动画结束后,幻灯片实际关闭之前)。我试图调用slide.setAnimation(SliderAnimationDown)然后调用slide.animateClose() - 但它什么也没做。我应该怎么做才能在SlidingDrawer上执行自定义动画关闭?