Reference version

This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

AccessoryWidgetBackground

一个 SwiftUI 自适应背景视图,可根据小组件的环境提供标准外观。

iOS
Included in Expo Go
Recommended version:
~57.0.0

Expo UI AccessoryWidgetBackground 与官方 SwiftUI AccessoryWidgetBackground API 相匹配,并创建一个自适应背景视图,根据小组件的环境提供标准外观。

安装

Terminal
npx expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

用法

基础配件小组件背景

BasicAccessoryWidgetBackground.tsx
import { AccessoryWidgetBackground, VStack, Text, ZStack } from '@expo/ui/swift-ui'; export default function BasicAccessoryWidgetBackground() { return ( <ZStack> <AccessoryWidgetBackground /> <VStack> <Text>MON</Text> </VStack> </ZStack> ); }

API

import { AccessoryWidgetBackground } from '@expo/ui/swift-ui';

Component

AccessoryWidgetBackground

Type: React.Element<AccessoryWidgetBackgroundProps>

AccessoryWidgetBackgroundProps