Zadjustment for Android animations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.