为什么我用SVG画的圆弧在安卓上正常,在IOS上起点是从右边3点的位置开始的?

https://img3.mukewang.com/5c9c30a2000115c000780083.jpg

在安卓上是这样的,浏览器模拟IOS的时候也是正常的,但是在手机上看就出问题了,有前辈遇到过这样的问题吗

https://img3.mukewang.com/5c9c30a400016d7b08000126.jpg


UYOU
浏览 301回答 1
1回答

婷婷同学_

在SVG外层元素的样式上,逆时针旋转90度就好了。注意:在IOS 10.x Safari中,90deg不生效,加任意小数点即可。<!DOCTYPE html><html><head>&nbsp; <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">&nbsp; <meta charset="UTF-8">&nbsp; <style>&nbsp; &nbsp; #circle {&nbsp; &nbsp; &nbsp; transform: rotate(-90.1deg); /* IOS 10.x Fix */&nbsp; &nbsp; &nbsp; -webkit-transform: rotate(-90.1deg);&nbsp; &nbsp; &nbsp; display: inline-block;&nbsp; &nbsp; }&nbsp; </style></head><body>&nbsp; <span id="circle">&nbsp; &nbsp; <svg width="100" height="100" viewBox="0 0 100 100">&nbsp; &nbsp; &nbsp; <circle fill="none" stroke="#eaeaea" stroke-width="8" cx="50" cy="50" r="46"></circle>&nbsp; &nbsp; &nbsp; <circle fill="none" stroke="red" stroke-width="8" stroke-miterlimit="1" stroke-dasharray="290, 290" stroke-linecap="round" cx="50" cy="50" r="46">&nbsp; &nbsp; &nbsp; &nbsp; <animate attributeName="stroke-dashoffset" begin="0s" dur="10s" from="290" to="0" repeatCount="1"></animate>&nbsp; &nbsp; &nbsp; </circle>&nbsp; &nbsp; </svg>&nbsp; </span></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript