Picker
メニュー、セグメント、ラジオグループ、インラインの各スタイルに対応した、制御された SwiftUI Picker です。
#インポート
github.com/egoist/quickgui/go/ui から ui をインポートします。
import (
"github.com/egoist/quickgui/go/native"
"github.com/egoist/quickgui/go/ui"
)#使い方
func SwiftUiPickerExample() *native.Node {
value, setValue := ui.CreateSignal("list")
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.Picker(ui.SwiftUIPickerProps{
Selection: value,
Options: []ui.SwiftUIPickerOption{{Value: "list", Label: "List"}, {Value: "grid", Label: "Grid"}},
OnSelectionChange: func(next string, _ *native.Event) { setValue(next) },
})
},
)
}#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
SwiftUI.Picker
ソースを見るui.SwiftUI.Picker(props SwiftUIPickerProps) *native.NodeTestIDany—
Modifiersany—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)ソースを見るSelectionany—
Optionsany—
Labelany—
Stylestring—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
stringソースを見る