react-native - 如何从反应抽屉顶部删除空间
解决方案
在 DrawerContentScrollView 中,@react-navigation/drawer 代码中添加了默认填充 4,因此只需在 contentContainerStyle 中传递 paddingTop 属性即可删除它。
const insets = useSafeArea();
<DrawerContentScrollView
contentContainerStyle={{
paddingTop: insets.top,
}}
{...props}>
</DrawerContentScrollView>