场景:我在一个AnimatedVectorDrawable中有一个ImageView实例的形状。单击此形状(ImageView)时,它将执行动画。此动画结束后,将执行一个新的活动。然后,当使用智能手机上的“返回”按钮时,将显示第一个活动。为了使AnimatedVectorDrawable出现在它的原始状态(没有动画应用),它的方法reset()可以在android 23之上调用。示例:
public void onStop() {
super.onStop();
avdLogo.reset()
}avdLogo指的是问题中的AnimatedVectorDrawable。
如何在23版中实现相同的功能
发布于 2018-10-28 07:46:18
将vectorDrawables.useSupportLibrary = true添加到模块的build.gradle的android部分的defaultConfig中。就像下面
android {
........
........
defaultConfig {
........
vectorDrawables.useSupportLibrary = true
}它将支持动画矢量绘图文件,以兼容使用的API低于洛利波普。
https://stackoverflow.com/questions/53026572
复制相似问题