更新时间:2023-01-25 17:16:38
我在一个新项目中测试了我的可绘制对象,令我惊讶的是它运行良好.
I tested my drawable in a new project and to my surprise it was working fine.
我在我的第一个项目中使用了 com.android.support:design:25.1.0
,结果降级为 com.android.support:design:24.2.0 代码>使其工作.
I was using com.android.support:design:25.1.0
in my first project and it turns out degrading to com.android.support:design:24.2.0
made it work.
经过更多测试后,我发现我的应用程序从 app:srcCompat ="@ drawable/animated_vector"
更改为 android:src ="@ drawable/animated_vector"
ImageView
使其也适用于 com.android.support:design:25.1.0
.
After testing a bit more I found that changing from app:srcCompat="@drawable/animated_vector"
to android:src="@drawable/animated_vector"
on my ImageView
made it work for com.android.support:design:25.1.0
as well.
我不确定发生了什么,但现在至少可以了.如果有人对此有更多详细信息,请告诉我.我以为我们应该在矢量可绘制对象中使用 srcCompat
.
Im not sure whats going on but now it works at least. If someone has more details on this please let me know. I thought we where supposed use srcCompat
for vector drawables.