本文へスキップ

QuickGUIHostView

SwiftUI 階層の中へ通常の QuickGUI サブツリーをリバースホストします。

#インポート

github.com/egoist/quickgui/go/ui から ui をインポートします。

import (
	"github.com/egoist/quickgui/go/ui"
)

#使い方

func SwiftUiQuickguiHostViewExample() *native.Node {
	return ui.SwiftUI.Host(
		ui.SwiftUIHostProps{MatchContents: true},
		func() *native.Node {
			return ui.SwiftUI.QuickGUIHostView(
				ui.SwiftUIQuickGUIHostViewProps{Width: 320, Height: 180},
				func() *ui.Element {
					return ui.View().Child(
						"QuickGUI inside SwiftUI",
					).Width("100%").Height("100%").Padding(16)
				},
			)
		},
	)
}

#API リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

SwiftUI.QuickGUIHostView

ソースを見る
ui.SwiftUI.QuickGUIHostView(props SwiftUIQuickGUIHostViewProps, children ...any) *native.Node

QuickGUIHostView is an independently owned QuickGUI renderer inside a SwiftUI hierarchy.

TestIDany—

Stable identifier for native automation and tests.

any
ソースを見る
Modifiersany—

Ordered SwiftUI view modifiers applied to the hosted control.

any
ソースを見る
Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
ソースを見る
ChildrenComponent—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

Component
ソースを見る
Widthany—

Declared logical width.

any
ソースを見る
Heightany—

Declared logical height.

any
ソースを見る
MatchContentsany—

Uses the hosted subtree’s intrinsic width, height, or both.

any
ソースを見る
Backgroundany—

Clear color for the reverse-hosted QuickGUI WGPU surface.

any
ソースを見る