SVG图标在ios和android上的显示方式有所不同

时间:2018-12-14 09:00:56

标签: react-native svg fontello

我在fontello上上传了一个svg图标

fontello icon seems good

如果在ios上完美显示 ios screenshot

但是在android上有很多空格 android screenshot

知道为什么吗?

这是我的svg文件

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" 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 71.8 73.9" style="enable-background:new 0 0 71.8 73.9;" xml:space="preserve">
<g>
<g>
    <path d="M38.1,36V2.1C38.1,0.9,37.1,0,36,0c-1.2,0-2.1,0.9-2.1,2.1V36c-4.8,1-8.5,5.2-8.5,10.3s3.6,9.4,8.5,10.3v15.1
        c0,1.2,0.9,2.1,2.1,2.1c1.2,0,2.1-0.9,2.1-2.1V56.7c4.8-1,8.5-5.2,8.5-10.3C46.5,41.3,42.9,37,38.1,36z M36,52.7
        c-3.5,0-6.4-2.9-6.4-6.4c0-3.5,2.9-6.4,6.4-6.4c3.5,0,6.4,2.9,6.4,6.4C42.4,49.9,39.5,52.7,36,52.7z"/>
    <path d="M12.6,18.6V2.1c0-1.2-0.9-2.1-2.1-2.1S8.5,0.9,8.5,2.1v16.5C3.6,19.6,0,23.8,0,28.9s3.6,9.4,8.5,10.3v32.5
        c0,1.2,0.9,2.1,2.1,2.1s2.1-0.9,2.1-2.1V39.3c4.8-1,8.5-5.2,8.5-10.3S17.4,19.6,12.6,18.6z M10.5,35.3c-3.5,0-6.4-2.9-6.4-6.4
        c0-3.5,2.9-6.4,6.4-6.4s6.4,2.9,6.4,6.4C16.9,32.5,14,35.3,10.5,35.3z"/>
    <path d="M63.3,18.6V2.1c0-1.2-0.9-2.1-2.1-2.1c-1.2,0-2.1,0.9-2.1,2.1v16.5c-4.8,1-8.5,5.2-8.5,10.3s3.6,9.4,8.5,10.3v32.5
        c0,1.2,0.9,2.1,2.1,2.1c1.2,0,2.1-0.9,2.1-2.1V39.3c4.8-1,8.5-5.2,8.5-10.3S68.2,19.6,63.3,18.6z M61.3,35.3
        c-3.5,0-6.4-2.9-6.4-6.4c0-3.5,2.9-6.4,6.4-6.4c3.5,0,6.4,2.9,6.4,6.4C67.6,32.5,64.8,35.3,61.3,35.3z"/>
</g>
</g>
</svg>

1 个答案:

答案 0 :(得分:0)

添加<svg width="71.8" height="73.9"道具(或任何其他保持相同比例的值)。