Android---控件View的GONE和VISIBLE动画

显示动画

TranslateAnimation 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.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);   

View的显示:

view.startAnimation(mShowAction);     
view.setVisibility(View.VISIBLE);  

View的隐藏:

view.startAnimation(mHiddenAction);     
view.setVisibility(View.GONE);   

你可能感兴趣的:(Anroid-知识点)