我想隐藏 dicelayout(dicelout 在 mainboardlinear 中)但是当动画完成时屏幕因为 View.GONE 而闪烁!如果我将 setfillafter 设置为 true 并清除 View.GONE,我不再有 flash 问题,但在这种情况下无法滚动 mainboardlinear 中的滚动视图!
final RelativeLayout rLayout=(RelativeLayout)findViewById(R.id.dicelayout);
Animation animation=new TranslateAnimation(0, 0, 0, -rLayout.getHeight());
animation.setFillAfter(false);
animation.setFillBefore(true);
animation.setDuration(1000);
((LinearLayout)findViewById(R.id.mainboardlinear)).startAnimation(animation);
Thread t=new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(999);
runOnUiThread(new Runnable() {
public void run() {
rLayout.setVisibility(View.GONE);
}
});
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
t.start();