我有一个动画,当它被点击时,我用它来使ImageView反弹。
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/bounce_interpolator">
<scale
android:duration="500"
android:fromXScale="1.5"
android:fromYScale="1.5"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>我就像这样应用它。
view.startAnimation(
AnimationUtils.loadAnimation(view.getContext(), R.anim.bounce));它工作得很好,但问题是动画不仅会影响在ImageView中绘制的图像,还会影响其背景。当动画发生时,其背景会放大并超出视图边界,与其旁边的其他视图重叠。有没有一种方法可以只将动画应用于ImageView中的Drawable,这样就不会影响视图背景?
(附注:如此问题已作答,请注明为复本。我已经搜索过了,但没有找到与我正在寻找的答案相匹配的答案。)
https://stackoverflow.com/questions/53858060
复制相似问题