UI弹出呈现
fullScreenCover
覆盖整个屏幕的弹出页面。
fullScreenCover(options) 的参数与 sheet 相同,但内容覆盖整个屏幕,用户无法下滑关闭,需要在内容中提供关闭按钮。
import { Button, Modifier, Text, useState, VStack } from "onescript/views"
function Onboarding() {
const [shown, setShown] = useState(true)
return (
<Text modifier={Modifier.fullScreenCover({
isPresented: shown,
onDismiss: () => setShown(false),
content: (
<VStack spacing={16}>
<Text>欢迎使用</Text>
<Button action={() => setShown(false)}>开始</Button>
</VStack>
),
})}>
首页
</Text>
)
}| 参数 | 类型 | 说明 |
|---|---|---|
isPresented | boolean | 是否显示。 |
onDismiss | () => void | 系统关闭时调用,需在其中把 isPresented 设为 false。 |
content | ViewChild | 弹出的内容。 |
How is this guide?
最后更新于