Android 如何围绕视图中心制作缩放动画?
我从XML文件加载缩放动画,然后将其设置为查看并启动。Android 如何围绕视图中心制作缩放动画?,android,android-animation,android-view,Android,Android Animation,Android View,我从XML文件加载缩放动画,然后将其设置为查看并启动。 我发现动画在视图的左上角附近。 我怎样才能绕着中心走 这是我的动画XML <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale android:fromXScale="0.5" android:toXSc
我发现动画在视图的左上角附近。
我怎样才能绕着中心走 这是我的动画XML
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:fromXScale="0.5"
android:toXScale="1.1"
android:fromYScale="0.5"
android:toYScale="1.1"
android:duration="200"/>
<scale
android:fromXScale="1"
android:toXScale="0.91"
android:fromYScale="1"
android:toYScale="0.91"
android:startOffset="200"
android:duration="400"/>
<alpha
android:fromAlpha="0.5"
android:toAlpha="1"
android:duration="400"/>
<alpha
android:fromAlpha="1"
android:toAlpha="0"
android:duration="300"
android:startOffset="700"/>
</set>
为什么不使用android:pivotX/android:pivotY? 唯一的一件事——小心价值观,我认为你需要50%或50%的利润
祝你好运非常感谢。这就是我想要的。
rightAnim = AnimationUtils.loadAnimation(this, R.anim.show_fade_out);
rightAnimObj.setAnimation(rightAnim);
rightAnim.startNow();