Android 反应本机全宽背景图像';安卓&x27;
我使用图像作为容器以获得全宽背景。它在emulator中正确运行,但当我在设备上打开应用程序时,背景是白色的。 谢谢你的关注Android 反应本机全宽背景图像';安卓&x27;,android,react-native,background-image,Android,React Native,Background Image,我使用图像作为容器以获得全宽背景。它在emulator中正确运行,但当我在设备上打开应用程序时,背景是白色的。 谢谢你的关注 <Container> <Content> <Image style={styles.bgImage} source={require('../../../images/login_bg.png')}> <View style={styles.wrapper}&
<Container>
<Content>
<Image
style={styles.bgImage}
source={require('../../../images/login_bg.png')}>
<View style={styles.wrapper}>
<Image
style={styles.logo}
source={require('../../../images/logo.png')} />
<Button
style={styles.button}
onPress={() => {this.logIn(username, password)}}>
<Text style={styles.buttonText}>LOGIN</Text>
</Button>
</View>
<View style={styles.footer}>
<Text style={styles.version}>Version 4.0.0</Text>
<Text style={styles.copyright}>© All rights reserved. Araqich is registered trademark of Araqich LLC.</Text>
</View>
</Image>
</Content>
</Container>
{this.logIn(用户名、密码)}>
登录
版本4.0.0
&抄袭;版权所有。Araqich是Araqich LLC的注册商标。
我认为如果使用alignSelf:“拉伸”
它将工作如下声明变量:
var width = Dimensions.get('window').width;
以你的风格
add : "width : width" with your other attributes
我不知道这是不是一个好办法。但是我使用我的图像作为一个容器,flex:1,width:null,height:null 在生产过程中,这两个平台都适用于我
return(
<Image source={require('/background_image.png')} style={{ flex: 1, width: null, height: null }} >
[ ... your JSX ... ]
</Image>
);
返回(
[…您的JSX…]
);
问题是从psd导出的图像不正确)
它给出了blob错误,该错误表示图像被覆盖Put
alignSelf:“stretch”
作为图像的一种样式,因为设备中的图像没有出现,所以该样式不起作用