跳到正文

QuickGUIHostView

在 SwiftUI 层级中反向托管一棵普通的 QuickGUI 子树。

#导入

从 @quickgui/solid/swift-ui 导入 QuickGUIHostView。

import { Host, QuickGUIHostView } from "@quickgui/solid/swift-ui";

#用法

<Host matchContents>
  <QuickGUIHostView width={280} height={120}>
    <View style={{ width: 280, height: 120, padding: 16 }}>
      <Text>Ordinary QuickGUI content</Text>
    </View>
  </QuickGUIHostView>
</Host>

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

QuickGUIHostView

查看源码
QuickGUIHostView(props: QuickGUIHostViewProps): NativeNode
testIDstring—

Stable identifier exposed to macOS accessibility and UI testing.

string
查看源码
modifiersViewModifier[]—

SwiftUI modifiers, applied in array order.

ViewModifier[]
查看源码
childrenunknown—

The one ordinary QuickGUI subtree rendered by this reverse host.

unknown
查看源码
widthnumber—

Fixed SwiftUI frame width and initial QuickGUI viewport width.

number
查看源码
heightnumber—

Fixed SwiftUI frame height and initial QuickGUI viewport height.

number
查看源码
matchContentsMatchContents—

Measure the ordinary QuickGUI subtree on either or both intrinsic axes.

MatchContents
查看源码
backgroundColorValue—

Clear color used by the embedded WGPU surface. Defaults to transparent.

ColorValue
查看源码
ref((node: NativeNode) => void) | NativeNode—

Declares ref (optional). Reactive JSX expressions update this property in place.

((node: NativeNode) => void) | NativeNode
查看源码