This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
仪表
一个用于显示带有视觉指示器进度的 SwiftUI 仪表组件。
Expo UI Gauge 与官方 SwiftUI Gauge API 保持一致,并支持通过 gaugeStyle 修饰符设置样式。


安装
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基础仪表
添加标签
你可以将自定义组件作为 children 传入,为仪表提供标签。
添加数值标签
使用 currentValueLabel、minimumValueLabel 和 maximumValueLabel 属性显示数值信息。
仪表样式
使用 gaugeStyle 修饰符更改仪表的外观。可用样式包括:automatic、circular、circularCapacity、linear 和 linearCapacity。
着色仪表
使用 tint 修饰符更改仪表的颜色。
API
import { Gauge } from '@expo/ui/swift-ui';
Component
Type: React.Element<GaugeProps>
Renders a SwiftUI Gauge component.
ReactNodeA label showing the current value. Use Text or Label to display the value.
ReactNodeA label showing the maximum value. Use Text or Label to display the value.
ReactNodeA label showing the minimum value. Use Text or Label to display the value.