0
我想在背景圖像的「前層」上呈現svg圖像。如何在背景圖像的前面渲染一個svg圖像來反應原生?
當視圖加載時,只有背景圖像出現,我沒有得到任何的錯誤。圖像是否加載(在背景的背景)?
這裏是我到目前爲止已經完成:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
Image,
} from 'react-native';
import SVGImage from 'react-native-svg-image';
export default class ShowScreen extends Component {
render() {
return (
<View style={styles.container}>
<Image
source={require('../img/image.jpg')}
style={styles.backgroundImage}
blurRadius={1}>
<View style={styles.content}>
<SVGImage
style={{ width: 80, height: 80 }}
source={{uri:'https://fluent-panda.appspot.com.storage.googleapis.com/dumbbell.svg'}}/>
</View>
</Image>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
backgroundImage: {
flex: 1,
alignSelf: 'stretch',
width: null,
justifyContent: 'center',
},
content: {
alignItems: 'center',
}
});
爲什麼圖像不顯示?我正在使用react-native。
也許嘗試添加柔性解決:1;到styles.content – lukaleli