react-native - 无法在具有高度的容器顶部放置图标
问题描述
我正在尝试创建一个容器,里面有一些信息,角落里有一个关闭按钮。容器本身具有一定的高度并包含一个TouchableWithoutFeedback
元素,关闭按钮也是如此。我试图让它像这样,但它看起来像这样(你可以在容器的左上角看到按钮。带有信息和图标的容器的View
样式以及两者的样式是:
infoContainer: {
backgroundColor: 'white',
borderRadius: 16,
paddingVertical: 17,
paddingHorizontal: 20,
flexDirection: 'row',
justifyContent: 'space-between',
width: wp('90%'),
shadowColor: '#0d263a',
shadowOpacity: 0.15,
shadowOffset: { width: 0, height: 15 },
elevation: 20,
borderWidth: 2,
marginBottom: 12,
zIndex: -1,
},
iconContainer: {
zIndex: 9999,
position: 'absolute',
backgroundColor: '#f3f8fe',
},
解决方案
推荐阅读
- java - 使用 SASL_SSL / PLAIN 连接时出现 Kafka AdminClient 错误
- python - 如何使用 Cloud Composer 运行数据流作业
- java - 如何将 Instant 设置为特定时间?
- python-3.x - 查找列表中每个单词的频率并在字典中显示结果
- javascript - 根据另一个数组的值将元素添加到数组中
- html - 在 r arsenal tableby 中设置第一个“术语”列的宽度
- javascript - 如何在javascript中创建一个包含长度为x的数字字符串的数组?
- kubernetes - 为每个 srimzi kafka 代理添加交易量
- c# - 如何使用机器人处理井字游戏中的异步按钮点击?
- php - 搜索 laravel 的总天数和出席人数