我正在使用来自 React Native 的 ImageBackground 组件。然而,无论我选择什么样式,都会显示相同的错误消息。代码如下所示:
render() {
return (
<ImageBackground
source={require('./common/Background_image.png')}
stlye={styles.backgroundStyle}
>
<Text>Some text here!!</Text>
</ImageBackground>
);
}
backgroundStyle: {
flex: 1,
width: null,
height: null,
resizeMode: 'cover'}
React-Native版本: react-native-cli: 2.0.1 react-native: 0.55.4
您有什么想法,为什么会出现这个错误吗?
width: null, height: null
?直接删除它然后再试一次。 - Helmer Barcos