Android:zadjustment:
Allows you to adjust the order of the playback content in the z-axis during animation playback,
Constants with integral type parameters
①normal (0): The animated content being played retains the current z-axis order,
②top (1): During animation playback, the current playback of the content is forced to put on top of other content;
③bottom (-1): Forces the currently played content to be placed under other content during animation playback
Code in Java:
1 animation.setzadjustment (animation.zorder_bottom);
The code in the XML
1 android:zadjustment= "Bottom"
Example:
1 <ImageView2 Android:id= "@+id/id_imageview"3 Android:layout_width= "Wrap_content"4 Android:layout_height= "Wrap_content"5 android:src= "@drawable/ic_launcher" />6 7 <ImageView8 Android:layout_width= "300DP"9 Android:layout_height= "300DP"Ten android:layout_centerinparent= "true" One android:src= "@drawable/dialog" />
1 PrivateImageView Mimageview;2 protected voidonCreate (Bundle savedinstancestate) {3 Super. OnCreate (savedinstancestate);4 Setcontentview (r.layout.fragment_main);5Mimageview =(ImageView) Findviewbyid (R.id.id_imageview);6Animation Animation =NewTranslateanimation (0, 1000, 0, 1000);7Animation.setduration (10000);8 animation.setzadjustment (Animation.zorder_bottom);//specified at the bottom of the z-axis9 mimageview.startanimation (animation);Ten}
Effect
Zadjustment for Android animations