android view控件的显示和隐藏动画效果

// 显示动画
mShowAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
-1.0f, Animation.RELATIVE_TO_SELF, -0.0f);
mShowAction.setRepeatMode(Animation.REVERSE);
mShowAction.setDuration(500);
// 隐藏动画
mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
-1.0f);
mHiddenAction.setDuration(500);

btn_setting.startAnimation(mShowAction);//开始动画

posted on 2015-11-02 15:05  赵磊磊  阅读(10035)  评论(0编辑  收藏  举报

导航