【发布时间】:2021-07-22 05:13:01
【问题描述】:
我有一个如下所示的自定义设计:
我想在三个条纹上叠加一个“X”标记。当我做绝对定位时,它有效,但仅适用于它包含在 / 它被切断的位置。如何将“X”叠加在下面的所有 's 之上?
<View style={styles.lightGrey}>
<View style={styles.red}>
<View style={styles.yellow}>
<View style={styles.teal}>
{!preview && (
<TouchableOpacity
onPress={async () => {
setIsLoadingDISLiked(true);
await onDisliked();
setIsLoadingDISLiked(false);
}}
>
<MaterialCommunityIcons
name="close-thick"
size={34}
color="black"
style={{
marginLeft: Constant.width * 0.65,
marginTop: Constant.height * 0.01,
position: "absolute",
}}
/>
</TouchableOpacity>
)}
</View>
造型
red: {
height: Constant.height * 0.08,
width: Constant.width,
backgroundColor: Colors.Brick,
},
yellow: {
height: Constant.height * 0.08,
width: Constant.width * 0.75,
backgroundColor: Colors.LightMustardYellow,
},
teal: {
height: Constant.height * 0.08,
width: Constant.width * 0.7,
backgroundColor: Colors.Teal,
},
lightGrey: {
backgroundColor: Colors.LightLightGrey,
paddingBottom: 100,
},
【问题讨论】:
标签: css react-native flexbox css-position react-native-stylesheet