admin管理员组文章数量:1565816
2024年6月12日发(作者:)
本文由我司收集整编,推荐下载,如有疑问,请与我司联系
如何动画相对布局的缩放(其中包含许多布局和ImageViews)
如何动画相对布局的缩放(其中包含许多布局和ImageViews)[英]How to
animate scaling of a relative layout(Which contains many layouts and ImageViews inside)
I tried with scaling but while scaling layouts inside are shrinking, Can anyone explain how
to animate a layout without shrinking
我尝试使用缩放,但是当内部缩放布局缩小时,任何人都可以解释如何在不收缩的情
况下为布局设置动画
need to scale letterLayout from a little bit above the parent bottom to top
需要从父母的底部到顶部稍微扩展一下letterLayout
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
VE_TO_SELF,
VE_TO_SELF,
0f,
1f);
//
//
Pivot
Pivot
point
point
of
of
X
Y
scaling
scaling
lAfter(false); // Needed to keep the result of the animation
ation(1000); nimation(anim); Layout code
RelativeLayout xmlns:android=“d/apk/res/android”
xmlns:tools=“d/tools”
android:layout_height=“match_parent”
xmlns:app=“d/apk/res-auto”
android:layout_width=“match_parent”
tools:context=“ScreenActivity” 0
I would suggest you to use a Value animator like this and change the margins of the
RelativeLayout:
我建议你使用像这样的Value animator并改变RelativeLayout的边距:
final Params params = (Params)
ValueAnimator va = outParams();
(initialMargin, finalMargin); int mDuration = 3000; //in millis
ation(mDuration); ateListener(new
版权声明:本文标题:【IT专家】如何动画相对布局的缩放(其中包含许多布局和ImageViews) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/shuma/1718122549a646468.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论