OneScript

presentationBackgroundInteraction

设置 sheet 下方的页面能否操作。

presentationBackgroundInteraction(interaction) 作用在 sheet 内容中的视图上,决定 sheet 弹出时下方页面能否点击、滚动。默认情况下 sheet 会给下方页面加上遮罩并禁止操作。

import { List, Modifier, Text } from "onescript/views"

<List modifier={Modifier
  .presentationDetents([{ height: 200 }, "medium", "large"])
  .presentationBackgroundInteraction({ enabledUpThrough: "medium" })}>
  <Text>附近的地点</Text>
</List>
值行为
"automatic"由系统决定,为默认值。
"disabled"下方页面不可操作。
"enabled"下方页面始终可操作,且不显示遮罩。
{ enabledUpThrough: PresentationDetent }sheet 不高于指定高度时下方页面可操作,更高时恢复遮罩。

How is this guide?

最后更新于