Ios React原生应用程序iphone 11主屏幕上的全屏背景图像
我目前正试图在iPhone11上的登录视图上设置一个完整的背景图像Ios React原生应用程序iphone 11主屏幕上的全屏背景图像,ios,typescript,react-native,Ios,Typescript,React Native,我目前正试图在iPhone11上的登录视图上设置一个完整的背景图像 const Background = styled.ImageBackground` padding:20px; justify-content:center; width:100%; height:100%; ` const styles = StyleSheet.create({ imageContainer: {
const Background = styled.ImageBackground`
padding:20px;
justify-content:center;
width:100%;
height:100%;
`
const styles = StyleSheet.create({
imageContainer: {
flex: 1,
alignItems: 'stretch'
},
image: {
flex: 1
}
});
return <SafeAreaView style={styles.imageContainer}><Background style={styles.image} source={require('../../assets/images/background-cover.jpg')}>
<CoverLogo width={100} height={100} color={Colors.White} />
<Introduction loop={false}>
<TextHeading text={`TestHeader`} />
</Background>
</SafeAreaView>
const Background=styled.ImageBackground`
填充:20px;
证明内容:中心;
宽度:100%;
身高:100%;
`
const styles=StyleSheet.create({
图像容器:{
弹性:1,
对齐项目:“拉伸”
},
图片:{
弹性:1
}
});
返回
当前输出的内容:
我想让背景占据空白。此问题似乎只出现在手机11s中您应该使用图像包装SafeAreaView,并确保SafeAreaView的不透明度设置为0
<ImageBackground
source={imgsrc}
style={{position: "absolute", height: "100%", width: "100%"}}>
<SafeAreaView style={{opacity: 0}}>
// place for your app components
</SafeAreaView>
</ImageBackground>
//放置应用程序组件的位置
尝试删除安全区域视图它仍然不起作用您是否在Xcode设置中使用全屏?@SaachiTech如何做到这一点?您可以在这里找到选项项目目标>常规>部署信息