您的位置:首页 > 移动开发 > Android开发

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

2015-11-02 15:05 786 查看
// 显示动画
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);//开始动画
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: