首页 > 解决方案 > 单击图片后使用camera2 api闪烁动画

问题描述

当用户单击图像时,我希望有某种动画。我尝试向BlinktexureView 添加动画,但它一直在闪烁。下面是代码:

Animation animation;
mTextureView = (AutoFitTextureView)view.FindViewById(Resource.Id.texture);
animation = AnimationUtils.LoadAnimation(Activity,Resource.Animation.blink);
mTextureView.StartAnimation(animation);

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha android:fromAlpha="0.0"
        android:toAlpha="1.0"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:duration="0"
        android:repeatMode="reverse"
        android:repeatCount="infinite"/>
</set>

我基本上想要一个默认的点击效果,当您通过相机应用程序点击图像时会出现这种效果。有什么办法可以做到这一点?

标签: androidanimationxamarin.android

解决方案


推荐阅读