跳至主要内容

博文

目前显示的是标签为“scale”的博文

android scale animation

public void scaleViewY (View v , float startScale , float endScale) { Animation anim = new ScaleAnimation( 1f , 1f , // Start and end values for the X axis scaling startScale , endScale , // Start and end values for the Y axis scaling Animation. RELATIVE_TO_SELF , 0f , // Pivot point of X scaling Animation. RELATIVE_TO_SELF , 0.5f ) ; // Pivot point of Y scaling anim.setFillAfter( true ) ; // Needed to keep the result of the animation anim.setDuration( 500 ) ; v.startAnimation(anim) ; }

android overidePendingTransition Scale

Intent intent= new Intent(MainActivity. this, Main2Activity. class ) ; startActivity(intent) ; overridePendingTransition(R.anim. zoomin , R.anim. zoomout ); @Override public void onBackPressed () { super .onBackPressed() ; overridePendingTransition(R.anim. fade_in , R.anim. fade_out ) ; } XML file : <? xml version= "1.0" encoding= "utf-8" ?> <set xmlns: android = "http://schemas.android.com/apk/res/android" > <scale android :fromXScale= "100%" android :toXScale= "0%" android :fromYScale= "100%" android :toYScale= "0%" android :pivotX= "50%" android :pivotY= "50%" android :duration= "1000" /> </set>