【发布时间】:2021-06-26 15:28:33
【问题描述】:
我想将一个图像放置在另一个图像之上,但它不应受到父图像“包含”参数的影响。如果我删除 resizeMode="contain" ,它工作正常,但否则,它看起来像这样:
我想要的是,将小图像放在父图像内。我实际上想将小图像放置在确切的角落。由于 resizeMode="contain" 而不是在空白处。我的代码如下所示:
<PagerView style={styles.pager} initialPage={0} showPageIndicator>
<View style={styles.picView} key={i}>
<ImageBackground
resizeMode="contain"
style={styles.pic}
source={{
uri: post.contents[i].path,
}}
>
<Image
style={{ position: "absolute", height: 100, width: 100 }}
source={{
uri: post.contents[i].path,
}}
/>
</ImageBackground>
</View>
</PagerView>
【问题讨论】:
标签: css reactjs react-native