The menu indicator visibility to apply.
Instance Method
インスタンスメソッド
menu
menuIndicator(_:)
Sets the menu indicator visibility for controls within this view.
Availability 有効性
- iOS 15.0+
- iPadOS 15.0+
- macOS 12.0+
- Mac Catalyst 15.0+
Technology
- Swift
UI
Declaration 宣言
func menuIndicator(_ visibility: Visibility
) -> some View
Parameters パラメータ
visibility
Discussion 議論
Use this modifier to override the default menu indicator visibility for controls in this view. For example, the code below creates a menu without an indicator:
Menu {
ForEach(history , id: \.self) { historyItem in
Button(historyItem.title) {
self.openURL(historyItem.url)
}
}
} label: {
Label("Back", systemImage: "chevron.backward")
.labelStyle(.iconOnly)
} primaryAction: {
if let last = history.last {
self.openURL(last.url)
}
}
.menuIndicator(.hidden)