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);//开始动画

上一篇:【LeetCode】20. Valid Parentheses


下一篇:ISO8583报文协议