@react-native-segmented-control/segmented-control

一个 React Native 库,提供从 iOS 渲染 UISegmentedControl 的组件。

Android
iOS
Web
Bundled version:
2.5.7

它就像一个花哨的单选按钮,或者用苹果的话来说:"由多个段组成的水平控件,每个段充当一个独立的按钮"(source)。该组件在 iOS 上渲染为 UISegmentedControl,并在 Android 和 Web 上忠实地再现该控件(因为这些平台的标准库上不存在等效项)。

¥It's like a fancy radio button, or in Apple's words: "A horizontal control that consists of multiple segments, each segment functioning as a discrete button" (source). This component renders to a UISegmentedControl on iOS, and to faithful recreations of that control on Android and web (because no equivalent exists on those platforms' standard libraries).

安装

¥Installation

Terminal
npx expo install @react-native-segmented-control/segmented-control

If you are installing this in an existing React Native app, make sure to install expo in your project. Then, follow the installation instructions provided in the library's README or documentation.

了解更多

¥Learn more

访问官方文档

获取有关 API 及其用法的完整信息。