我正在使用Android模拟器,SafeAreaProvider不工作(即,转到屏幕顶部太远)
import { StatusBar } from "expo-status-bar";
import { NavigationContainer } from "@react-navigation/native";
import RootNavigator from "./navigator/RootNavigator";
import { Provider } from "react-redux";
import { store } from "./redux/store";
import { SafeAreaProvider } from "react-native-safe-area-context";
export default function App() {
return (
<SafeAreaProvider>
<NavigationContainer>
<StatusBar style="auto" />
<Provider store={store}>
<RootNavigator />
</Provider>
</NavigationContainer>
</SafeAreaProvider>
);
}
1条答案
按热度按时间hmmo2u0o1#
你需要用SafeAreaView Package 你的应用程序才能使它工作。从同一个库导入它,并将你的代码更新为: