admin管理员组文章数量:1334887
I have an animated SVG that I want to implement in my application, I have found a way but I don't know if it is the most appropriate.
The thing is that it works for Android while it doesn't work on iOS.
This is the xaml.cs:
private void LoadSvg()
{
string svgContent = @"
<svg viewbox='0 0 64 48'>
<style>
:is(#back2087, #front2087) {
fill: none;
stroke-width: 3;
stroke-linecap: round;
stroke-linejoin: round;
}
#back2087 {
fill: none;
stroke: currentColor;
opacity: 0.1;
}
#front2087 {
fill: none;
stroke: currentColor;
stroke-dasharray: 48, 144;
stroke-dashoffset: 192;
animation: dash_682 1.4s linear infinite;
}
@keyframes dash_682 {
72.5% {
opacity: 0;
}
to {
stroke-dashoffset: 0;
}
}
</style>
<polyline points='0.157 23.954, 14 23.954, 21.843 48, 43 0, 50 24, 64 24' id='back2087'/>
<polyline points='0.157 23.954, 14 23.954, 21.843 48, 43 0, 50 24, 64 24' id='front2087'/>
</svg>";
SvgWebView.Source = new HtmlWebViewSource
{
Html = svgContent
};
}
And in the view:
<WebView x:Name="SvgWebView" HeightRequest="70" WidthRequest="70" BackgroundColor="Transparent" />
本文标签: cHow do I make an animated svg work Net MAUIStack Overflow
版权声明:本文标题:c# - How do I make an animated svg work? .Net MAUI - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742368401a2461750.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论