發表文章

目前顯示的是 12月, 2018的文章

幾個android常用到的動態XML

Animation animation; animation = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.xxxx_animation); R.anim.XXXX_animation 就以下面的XML,記得放在res/anim/之中,沒有anim,就需要自已在res底下建一個anim的資料匣 Button.startAnimation(animation); 使用方式如上,startAnimation(animation) 即可。 XML 範例 Fade Out Animation <set xmlns:android="http://schemas.android.com/apk/res/android"     android:fillAfter="true" >     <alpha         android:duration="2000"         android:fromAlpha="0.0"         android:interpolator="@android:anim/accelerate_interpolator"         android:toAlpha="1.0" /> </set> Zoom In Animation <set xmlns:android="http://schemas.android.com/apk/res/android"     android:fillAfter="true" >     <scale         xmlns:android="http://schemas.android.com/apk/res/android"         android:duration="1200"         android:fromXSca