2
我在Cordova(版本6.0.0)中遇到了svg动画的问题:我的Android上没有显示破折号(圆圈已满)。Cordova SVG stroke-dashoffset动画无效
行为在我的Android 5.0:在我的Chrome检查
行为:
这里一个demo,如果你想
下面是HTML:
<svg class="spinner" width="65px" height="65px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>
</svg>
这里是CSS:
.path {
stroke-dasharray: 187;
stroke-dashoffset: 0;
-webkit-transform-origin: center;
transform-origin: center;
stroke: #4285F4;
-webkit-animation: dash 1.4s ease-in-out infinite;
animation: dash 1.4s ease-in-out infinite;
}
@-webkit-keyframes dash {
0% {
stroke-dashoffset: 187;
}
50% {
stroke-dashoffset: 46.75;
}
100% {
stroke-dashoffset: 187;
}
}
@keyframes dash {
0% {
stroke-dashoffset: 187;
}
50% {
stroke-dashoffset: 46.75;
}
100% {
stroke-dashoffset: 187;
}
}
我试图把
- 负值,如:
stroke-dasharray: -187;
- 百分比值,如:
stroke-dasharray: 50%;
但它不起作用。
你有什么想法吗?谢谢 !