React native 无法在我的屏幕的Appbar上覆盖图像。(反应本机,反应本机纸张)
我试图在Appbar组件上重叠一个图像,但没有发生 这是我的密码React native 无法在我的屏幕的Appbar上覆盖图像。(反应本机,反应本机纸张),react-native,react-native-paper,React Native,React Native Paper,我试图在Appbar组件上重叠一个图像,但没有发生 这是我的密码 <View style={{flex: 1, backgroundColor: '#F6F8FB'}}> <Appbar.Header style={styles.appHeader}> <Appbar.BackAction /> </Appbar.Header> <Image source
<View style={{flex: 1, backgroundColor: '#F6F8FB'}}>
<Appbar.Header style={styles.appHeader}>
<Appbar.BackAction />
</Appbar.Header>
<Image
source={require('../../../resource/images/LivingRoom.png')}
style={styles.imageStyle}
/>
</View>
我需要帮助
像这样的图像尝试将
位置:'absolute
添加到imageStyle
imageStyle: {
postion: 'absolute',
top: 0,
left: 0,
width: '100%',
height: (25 / 100) * height,
borderTopLeftRadius: 50,
borderTopRightRadius: 40,
},
现在,您可以通过在
标记后编辑顶部写入
来播放图像位置
<View style={{flex: 1, backgroundColor: '#F6F8FB'}}>
<Appbar.Header style={styles.appHeader}>
<Appbar.BackAction />
<Image
source={require('../../../resource/images/LivingRoom.png')}
style={styles.imageStyle}
/>
</Appbar.Header>
</View>
no,图像刚刚消失,top:value
不起作用。也尝试了marginTop
但没有成功高度值是多少?一定要检查你的“身高”。让我们把你的高度设为:100,checkHeight是我的手机屏幕高度这是一个问题还是一个答案?对不起,请在图像结束标记后写上“请标记”。
<View style={{flex: 1, backgroundColor: '#F6F8FB'}}>
<Appbar.Header style={styles.appHeader}>
<Appbar.BackAction />
<Image
source={require('../../../resource/images/LivingRoom.png')}
style={styles.imageStyle}
/>
</Appbar.Header>
</View>