我给出了一个ImageBackground组件,我希望它占据整个屏幕,但它似乎有很小的填充,即使我将图像调整两倍或更多。它是从哪里来的?

Here is the code of the component
import React from "react";
import { View, Text, Button, ImageBackground, StyleSheet } from "react-
native";
export class HomeScreen extends React.Component {
static navigationOptions = {
//To hide the NavigationBar from current Screen
header: null
};
render() {
return (
<ImageBackground source={require('../imgs/bgx.png')} style={
styles.container }>
</ImageBackground>
);
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'stretch',
resizeMode: 'stretch'
}
});发布于 2019-04-05 03:58:17
确保源图像周围没有任何透明度。
将width: '100%'和height: '100%'设置为ImageBackground组件。它会改变什么吗?
发布于 2019-04-05 12:14:02
添加width='100%'和height='100%'
https://stackoverflow.com/questions/55523925
复制相似问题