ios - iOS (iPad/iPhone) 上未保留 SVG 透明度

标签 ios css iphone svg

我有一个 SVG 似乎不适用于 iOS 设备。

我在 chrome 和 safari 中都尝试过,只有 SVG 显示为纯蓝色 block 颜色,并且不保留不同的图层及其不透明度级别...

https://jsfiddle.net/2fLuspdm/

<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
 viewBox="0 0 1920 3840" style="enable-background:new 0 0 1920 3840;" xml:space="preserve">
    <style type="text/css">    
        .st0{opacity:6.000000e-02;fill:#609FD0;enable-background:new    ;}
    </style>
    <polygon class="st0" points="1920,2614 1920,3641 1470,3005.1 "/>
    <polygon class="st0" points="1920,1612.4 1210,780 1920,0.4 "/>
    <polyline class="st0" points="0,0 650,0 0,1184.3 1,0 "/>
    <polygon class="st0" points="0,898.4 960,1457 0,2778.4 "/>
    <polygon class="st0" points="0,3837.4 0,2654 1040,3840 "/>
    <polygon class="st0" points="1920,2926 1424,2239 1920,1046 "/>
    <polygon class="st0" points="829,3840 1920,2926 1936,3840 "/>
    <polygon class="st0" points="0,2530 0,1760 960,2909 "/>
    <polygon class="st0" points="1920,0.4 1920,622 40,0.4 "/>
    <polygon class="st0" points="1920,1634.5 1920,2404.5 1150,1435.5 "/>
</svg>

最佳答案

简单地计算指数(不确定它是否是有效的 SVG 语法,但 Safari 不喜欢它)。

<style type="text/css">    
    .st0{opacity:.06; fill:#609FD0; enable-background:new ;}
</style>

关于ios - iOS (iPad/iPhone) 上未保留 SVG 透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40525503/

相关文章:

javascript - Bootstrap 在单击另一个下拉菜单时关闭下拉菜单

css - 侧边栏菜单下拉菜单从右边下来

iphone - 在 iOS 应用程序上使用 android shape xml 资源

ios - 如何在 iOS 中以编程方式绘制到显示屏?

Web 服务应用程序的 iOS 应用程序架构

css - 需要边框来拉伸(stretch)整个菜单栏,而不仅仅是菜单项

iphone - 如何录制视频并使其慢动作

ios - 键值观察 exposureDuration

ios - 按钮标签无法在循环中使用动态值?

iphone - 将 Google Analytics 实现到 iOS 时出错