@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 file to discover all available pages.
重要
@expo/uiprovides a drop-in replacement for@react-native-segmented-control/segmented-control, powered by Jetpack Compose on Android and SwiftUI on iOS.
它有点像一个花哨的单选按钮,或者用 Apple 的话说:“一种由多个分段组成的水平控件,每个分段都作为一个独立按钮发挥作用” (source)。这个组件在 iOS 上渲染为 UISegmentedControl,而在 Android 和 web 上则会忠实地重现该控件(因为这些平台的标准库中没有对应实现)。
安装
Terminal
- npx expo install @react-native-segmented-control/segmented-controlIf 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 及其用法的完整信息。