Button
原生 SwiftUI 按钮,支持文本、SF Symbol、语义角色和按下处理。
#导入
从 quickgui 导入 SwiftUiButton。
use quickgui::*;#用法
SwiftUiButton::new(1)
.label("Save")
.system_image("checkmark")
.style(SwiftUiButtonStyle::BorderedProminent)#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
SwiftUiButton
查看源码pub fn new(id: u64) -> Selflabelpub fn label(mut self, label: impl Into<Arc<str>>) -> Self—
system_imagepub fn system_image(mut self, name: impl Into<Arc<str>>) -> Self—
Configures system image for this part.
pub fn system_image(mut self, name: impl Into<Arc<str>>) -> Self查看源码rolepub fn role(mut self, role: SwiftUiButtonRole) -> Self—
targetpub fn target(mut self, target: 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查看源码stylepub fn style(mut self, style: SwiftUiButtonStyle) -> Self—
Convenience builder equivalent to Expo's `buttonStyle` modifier.
pub fn style(mut self, style: SwiftUiButtonStyle) -> Self查看源码control_sizepub fn control_size(mut self, size: SwiftUiControlSize) -> Self—
Convenience builder equivalent to Expo's `controlSize` modifier.
pub fn control_size(mut self, size: SwiftUiControlSize) -> Self查看源码disabledpub fn disabled(mut self, disabled: bool) -> Self—
Convenience builder equivalent to Expo's `disabled` modifier.
pub fn disabled(mut self, disabled: bool) -> Self查看源码