首页指南参考教程

SegmentedControl

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

Android
iOS
Web

它就像一个花哨的单选按钮,或者用苹果的话来说:"由多个段组成的水平控件,每个段充当一个独立的按钮"(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 (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.

用法

¥Usage

请参阅 react-native-community/segmented-control 处的完整文档。

¥See full documentation at react-native-community/segmented-control.

Expo 中文网 - 粤ICP备13048890号