SegmentedControl
原生分段选择器,支持值选择和中性的 Xcode 风格标签页角色。
#导入
从 quickgui 导入 SwiftUiPicker。
use quickgui::*;#用法
SwiftUiPicker::segmented(
1,
"code",
[SwiftUiPickerOption::new("code", "Code"), SwiftUiPickerOption::new("preview", "Preview")],
)#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
SwiftUiPicker
查看源码pub fn segmented( id: u64, selection: impl Into<Arc<str>>, options: impl IntoIterator<Item = SwiftUiPickerOption>, ) -> SelfConvenience constructor for SwiftUI's segmented picker style.
newpub fn new( id: u64, selection: impl Into<Arc<str>>, options: impl IntoIterator<Item = SwiftUiPickerOption>, ) -> Self—
Configures new for this part.
pub fn new( id: u64, selection: impl Into<Arc<str>>, options: impl IntoIterator<Item = SwiftUiPickerOption>, ) -> Self查看源码tabspub fn tabs( id: u64, selection: impl Into<Arc<str>>, options: impl IntoIterator<Item = SwiftUiPickerOption>, ) -> Self—
Convenience constructor for segmented tab navigation.
pub fn tabs( id: u64, selection: impl Into<Arc<str>>, options: impl IntoIterator<Item = SwiftUiPickerOption>, ) -> Self查看源码stylepub fn style(mut self, style: SwiftUiPickerStyle) -> Self—
labelpub fn label(mut self, label: impl Into<Arc<str>>) -> Self—
test_idpub fn test_id(mut self, test_id: impl Into<Arc<str>>) -> Self—
modifierpub fn modifier(mut self, modifier: SwiftUiModifier) -> Self—
modifierspub fn modifiers(mut self, modifiers: impl IntoIterator<Item = SwiftUiModifier>) -> Self—
Configures modifiers for this part.
pub fn modifiers(mut self, modifiers: impl IntoIterator<Item = SwiftUiModifier>) -> Self查看源码on_value_changepub fn on_value_change(mut self, enabled: bool) -> Self—
Configures on value change for this part.
pub fn on_value_change(mut self, enabled: bool) -> Self查看源码