首页指南参考教程

屏幕

一个库,提供原生原语来表示屏幕,而不是普通的 React Native View 组件,以实现更好的操作系统行为和屏幕优化。

Android
iOS
tvOS
Web

react-native-screens 提供原生原语来表示屏幕,而不是普通的 <View> 组件,以便更好地利用操作系统行为和屏幕周围的优化。此功能由库作者使用,大多数应用开发者不太可能直接使用。它还提供了 React Navigation 的 createNativeStackNavigator 所需的原生组件。

¥react-native-screens provides native primitives to represent screens instead of plain <View> components To better take advantage of operating system behavior and optimizations around screens. This capability is used by library authors and is unlikely to be used directly by most app developers. It also provides the native components needed for React Navigation's createNativeStackNavigator.

注意:如果遇到任何问题,请参阅 react-native-screens 问题跟踪器

¥Note: See react-native-screens issue tracker if you encounter any problems.

安装

¥Installation

Terminal
npx expo install react-native-screens

If you are installing this in an existing React Native app (bare workflow), start by installing expo in your project. Then, follow the additional instructions as mentioned by library's README under "Installation in bare React Native projects" section.

API

完整的 API 参考和文档可在 react-native-screens 自述文件 中找到。

¥The complete API reference and documentation are available in the react-native-screens README.

如果你正在使用 React Navigation,要使用原生堆栈导航器,请参阅 createNativeStackNavigator 文档

¥To use the native stack navigator if you are using React Navigation, see createNativeStackNavigator documentation.

Expo 中文网 - 粤ICP备13048890号