How to show SVG file on React Native?

后端 未结 13 1612
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 11:13

I want to show svg files (I have bunch of svg images) but the thing I couldn\'t find the way to show. I tried to use Image and Use componen

13条回答
  •  旧时难觅i
    2020-12-12 11:54

    import React from 'react'
    import SvgUri from 'react-native-svg-uri';
    
    export default function Splash() {
      return (
        
          {/* provided the svg file is stored locally */}
          
          {/* if the svg is online */}
          
    
          
            Text
          
        
      )
    }
    
    const styles = StyleSheet.create({
      container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
      },
      logoText: {
        fontSize: 50
      }
    });
    

提交回复
热议问题