用法一
實例方法
help(_:)
使用您提供的文本視圖將幫助文本添加到視圖。
聲明
func help(_ text: Text) -> some View
參數
text
用作幫助的文本視圖。
詳述
向視圖添加幫助會在 macOS 上配置視圖的可訪問性提示及其工具提示 (“help tag”)。有關使用幫助標簽的更多信息,請參閱 macOS 人機接口指南中的 Help。
Slider("Opacity", value: $selectedShape.opacity)
.help(Text("Adjust the opacity of the selected \(selectedShape.name)"))
可用版本
iOS 14.0+, iPadOS 14.0+, macOS 11.0+, Mac Catalyst 14.0+, tvOS 14.0+, watchOS 7.0+
用法二
實例方法
help(_:)
使用您提供的本地化字符串將幫助文本添加到視圖。
聲明
func help(_ textKey: LocalizedStringKey) -> some View
參數
textKey
用作幫助的本地化文本的鍵。
詳述
向視圖添加幫助會在 macOS 上配置視圖的可訪問性提示及其工具提示 (“help tag”)。有關使用幫助標簽的更多信息,請參閱 macOS 人機接口指南中的 Help。
Button(action: composeMessage) {
Image(systemName: "square.and.pencil")
}
.help("Compose a new message")
可用版本
iOS 14.0+, iPadOS 14.0+, macOS 11.0+, Mac Catalyst 14.0+, tvOS 14.0+, watchOS 7.0+
用法三
實例方法
help(_:)
使用您提供的字符串將幫助文本添加到視圖。
聲明
func help<S>(_ text: S) -> some View where S : StringProtocol
參數
text
用作幫助的文本。
詳述
向視圖添加幫助會在 macOS 上配置視圖的可訪問性提示及其工具提示 (“help tag”)。有關使用幫助標簽的更多信息,請參閱 macOS 人機接口指南中的 Help。
Image(systemName: "pin.circle")
.foregroundColor(pointOfInterest.tintColor)
.help(pointOfInterest.name)
可用版本
iOS 14.0+, iPadOS 14.0+, macOS 11.0+, Mac Catalyst 14.0+, tvOS 14.0+, watchOS 7.0+
相關用法
- Swift Optional headerProminence(_:)用法及代碼示例
- Swift Optional hidden()用法及代碼示例
- Swift Optional highPriorityGesture(_:including:)用法及代碼示例
- Swift Optional horizontalRadioGroupLayout()用法及代碼示例
- Swift Optional hueRotation(_:)用法及代碼示例
- Swift Optional symbolVariant(_:)用法及代碼示例
- Swift Optional popover(isPresented:attachmentAnchor:arrowEdge:content:)用法及代碼示例
- Swift Optional mask(alignment:_:)用法及代碼示例
- Swift Optional listSectionSeparatorTint(_:edges:)用法及代碼示例
- Swift Optional badge(_:)用法及代碼示例
- Swift Optional fullScreenCover(isPresented:onDismiss:content:)用法及代碼示例
- Swift Optional keyboardType(_:)用法及代碼示例
- Swift Optional clipShape(_:style:)用法及代碼示例
- Swift Optional preferredColorScheme(_:)用法及代碼示例
- Swift Optional background(_:ignoresSafeAreaEdges:)用法及代碼示例
- Swift Optional saturation(_:)用法及代碼示例
- Swift Optional focusSection()用法及代碼示例
- Swift Optional overlay(alignment:content:)用法及代碼示例
- Swift Optional colorMultiply(_:)用法及代碼示例
- Swift Optional confirmationDialog(_:isPresented:titleVisibility:presenting:actions:message:)用法及代碼示例
- Swift Optional offset(_:)用法及代碼示例
- Swift Optional focused(_:equals:)用法及代碼示例
- Swift Optional previewDevice(_:)用法及代碼示例
- Swift Optional keyboardShortcut(_:modifiers:localization:)用法及代碼示例
- Swift Optional imageScale(_:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Optional help(_:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。