【发布时间】:2021-05-07 01:53:00
【问题描述】:
在这里,我查看了添加图像背景和两个按钮的视图,但我无法更改按钮的位置
<ImageBackground
style={styles.container}
resizeMode="cover"
source={require("../../assets/loginsignup.png")}
>
<Button
style={styles.button}
title=""
onPress={() => navigation.navigate("Login")}
/>
<Button title="" onPress={() => navigation.navigate("Register")} />
</ImageBackground>
</View>
这是我实现的风格
container: {
width: "100%",
height: "100%",
position: "relative",
top: 0,
left: 0,
},
button: {
width: "100%",
height: "100%",
position: "absolute",
top: 345,
},
});
我尝试对 imagebackground 中的文本做同样的事情,效果很好
【问题讨论】:
标签: javascript node.js react-native expo