问题可能与导航组件中的 SafeAreaView 冲突有关。您可以像这样跳过 SafeArea 的底部填充,
import {SafeAreaView} from 'react-native-safe-area-context';
<SafeAreaView
edges={['right', 'top', 'left']}
style={{flex: 1, backgroundColor: 'yellow'}}>
<View style={{flex: 1, backgroundColor: 'green'}}></View>
</SafeAreaView>
或用于带有 Hooks 的功能组件
import { useSafeAreaInsets } from 'react-native-safe-area-context';
const insets = useSafeAreaInsets();
<View
style={{
paddingTop: Math.max(insets.top, 16),
flex: 1,
backgroundColor: 'yellow',
}}>
<View style={{flex: 1, backgroundColor: 'green'}}></View>
</View>
有关react-native-safe-area-context
API的更多详细信息,请单击此处