Reference version

This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 55).

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

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

Android
iOS
Web
Included in Expo Go

For the complete documentation index, see llms.txt. Use this Use this file to discover all available pages.

这就像一个花哨的单选按钮,或者用 Apple 的话来说:“一种由多个段组成的水平控件,每个段都作为一个独立按钮发挥作用” (source)。此组件在 iOS 上会渲染为一个 UISegmentedControl,而在 Android 和 web 上则会渲染为对该控件的忠实复刻(因为这些平台的标准库中没有对应的控件)。

安装

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.

了解更多

访问官方文档

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