This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
背景
一个 SwiftUI 背景组件,用于在另一个视图后面叠加内容。
Expo UI 背景与官方 SwiftUI 的 background 修饰符相匹配,并在视图后绘制背景内容,按照指定的对齐方式定位。基础视图保持自己的大小。
信息 要用颜色、材质或渐变填充视图,请使用
@expo/ui/swift-ui/modifiers中的background修饰符。
安装
🌐 Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
🌐 Usage
基本背景
🌐 Basic background
背景对齐
🌐 Background alignment
使用 alignment 属性可以将背景内容相对于基础视图进行定位。由于背景不会影响基础视图的布局,所以较小的背景可以固定在其某一边缘。
🌐 Use the alignment prop to position the background content relative to the base view. Because the background does not affect the layout of the base view, a smaller background can be pinned to one of its edges.
应用接口
🌐 API
import { Background } from '@expo/ui/swift-ui';
No API data file found, sorry!