本文へスキップ

Stepper

値の範囲を制限できる、制御されたネイティブ数値 Stepper です。

#インポート

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

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

#使い方

func SwiftUiStepperExample() *native.Node {
	value, setValue := ui.CreateSignal(40.0)
	return ui.SwiftUI.Host(
		ui.SwiftUIHostProps{MatchContents: true},
		func() *native.Node {
			return ui.SwiftUI.Stepper(ui.SwiftUIStepperProps{
				Value:         value,
				Min:           0,
				Max:           100,
				Step:          1,
				Label:         "Value",
				OnValueChange: func(next float64, _ *native.Event) { setValue(next) },
			})
		},
	)
}

#API リファレンス

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

SwiftUI.Stepper

ソースを見る
ui.SwiftUI.Stepper(props SwiftUIStepperProps) *native.Node
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)
ソースを見る
Valueany—

The current controlled value. Update application state from the change callback to accept a new value.

any
ソースを見る
Minany—

Lower bound of the accepted value.

any
ソースを見る
Maxany—

Upper bound of the accepted value.

any
ソースを見る
Stepany—

Increment applied by pointer, keyboard, or step controls.

any
ソースを見る
Labelany—

Visible native SwiftUI control label.

any
ソースを見る
OnValueChangefunc(float64, *native.Event)—

Reports an accepted value change. Use the callback payload to update controlled state.

func(float64, *native.Event)
ソースを見る