import Image from 'react-native-remote-svg';
<Image
style={styling.imageStyle}
source={require('../res/images/sampleImage.svg')} />
1 回答
1
您必须预加载它们,因此它们将在 生产环境 版本中可用 .
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
require('./assets/svg/some.svg')
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free
// to remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
]);
1 回答
您必须预加载它们,因此它们将在 生产环境 版本中可用 .
};
在您的expo项目的App.js文件中 .