2012-12-27 74 views
0

我想要一个imagebutton中心屏幕,打开开始“成长”,使用某种动画顺利地填充整个屏幕。在达到完整大小后,将动画反转回原始大小?动画imageButton调整大小以适合屏幕

有什么想法?这甚至有可能吗?

+0

绝对有可能的,你有没有试图建立一个动画xml文件? – kabuto178

回答

2

这里是一个样本,让你开始创建动画的XML文件,使用此布局, RES /动画/ animate.xml

 <?xml version="1.0" encoding="utf-8"?> 
     <set xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shareInterpolator="false"> 
    <scale 
    android:interpolator="@android:anim/accelerate_decelerate_interpolator" 
    android:fromXScale="1.0" 
    android:toXScale="2.0" 
    android:fromYScale="1.0" 
    android:toYScale="2.0" 
    android:repeatMode="reverse" 
    android:duration="700" /> 
    </set> 

,并在你的方法来启动动画使用此

Animation scaleAnim = AnimationUtils.loadAnimation(this, R.anim.animate); 
view.startAnimation(scaleAnim); 

详细了解这里的动画Animations

+0

完美!非常感谢你,我有一个新发现的动画爱! – Broak

+0

我知道的感觉,并欢迎您:) – kabuto178

相关问题