Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to customize the effects of each element in set during animation by android

2025-04-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how android customizes the effects of various elements in set when animating. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Fade in and out animation effect

Android:fromAlpha= "1.0f" / / initial transparency

Android:toAlpha= "0.0f" / / end transparency

Android:duration= "500" / / Animation duration (in ms)

Gradual size stretch animation effect

Android:fromXScale= "1.0" android:toXScale=" 1.4" / / horizontal stretch

Android:fromYScale= "1.0" android:toYScale= "0.6" / / Vertical Compression

Horizontal and / or vertical motion

There are three presentation formats:

1. The percentage of 100% to 100% relative to itself.

2. The percentage of 100% P to 100% P relative to the parent component

3.folat value has no suffix to indicate absolute value

Android:fromXDelta= "100% p" android:toXDelta= "0" / / from the right boundary of the parent component to the middle

Rotation animation

Android:fromDegrees= "0" / / start Angle

Android:toDegrees= "- 45" / / negative end angle indicates counterclockwise

Multiple animation combinations

/ / initialize Translate animation

TranslateAnimation = new TranslateAnimation (0.1f 100.0f, 0.1f 100.0f)

/ / initialize Alpha animation

AlphaAnimation = new AlphaAnimation (0.1f, 1.0F)

/ / Animation set

AnimationSet set = new AnimationSet (true)

Set.addAnimation (translateAnimation)

Set.addAnimation (alphaAnimation)

/ / set animation time (works on each animation)

Set.setDuration (1000)

This.startAnimation (set)

Thank you for reading! This is the end of this article on "how to customize the effects of the elements in android when animating set". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report