DatePicker
制御されたネイティブの日付または日時ピッカーです。
#インポート
github.com/egoist/quickgui/go/ui から ui をインポートします。
import (
"github.com/egoist/quickgui/go/native"
"github.com/egoist/quickgui/go/ui"
"time"
)#使い方
func SwiftUiDatePickerExample() *native.Node {
value, setValue := ui.CreateSignal(float64(time.Now().UnixMilli()))
return ui.SwiftUI.Host(
ui.SwiftUIHostProps{MatchContents: true},
func() *native.Node {
return ui.SwiftUI.DatePicker(ui.SwiftUIDatePickerProps{
Value: value,
DisplayedComponents: "dateAndTime",
OnValueChange: func(next float64, _ *native.Event) { setValue(next) },
})
},
)
}#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
SwiftUI.DatePicker
ソースを見るui.SwiftUI.DatePicker(props SwiftUIDatePickerProps) *native.NodeTestIDany—
Modifiersany—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)ソースを見るValueany—
The current controlled value. Update application state from the change callback to accept a new value.
anyソースを見るMinany—
Maxany—
Labelany—
DisplayedComponentsstring—
Stylestring—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
stringソースを見るOnValueChangefunc(float64, *native.Event)—
Reports an accepted value change. Use the callback payload to update controlled state.
func(float64, *native.Event)ソースを見る