【发布时间】:2021-06-24 01:42:35
【问题描述】:
我想修复页面底部的页脚,
这就是为什么我的整个容器都在flex:1 所以它占用了所有空间,
在我的页脚中,我添加了position:"absolute",marginBottom:0,,页脚影响如此之大,这是我没想到的。它像页面标题一样上升,然后我将其删除,
如何在页面底部修复它?
这是相关代码。
<SafeAreaView style={{ flex: 1, backgroundColor:"#ffffff", }}>
{/* Footer */}
<View style={{ flexDirection:"row", alignItems:"center", justifyContent:"space-between",marginHorizontal:35,}}>
<View> // here there are some code
<View>
<Home height={30} width={22} fill={"#1E2439"} />
<Ratio height={30} width={22} fill={"#1E2439"} />
<Time height={30} width={22} fill={"#1E2439"} />
<User height={30} width={22} fill={"#1E2439"} />
</View>
</View>
</SafeAreaView>
【问题讨论】:
-
你的问题不清楚。在 react-native 中,如果你使用绝对位置,你应该给它一个宽度和高度。
-
当我使用宽度,高度时它仍然不起作用,我添加marginBottom:0,不,它不会进入底部
-
你应该使用bottom:0,而不是margin-bottom。
标签: css react-native