Код: Выделить всё
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {}, label: {
Text("Button")
})
}
}
< /code>
navigationBarItems(leading:trailing:)Я использовал контекстмену на кнопке. < /P>
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {}, label: {
Text("Button")
})
.contextMenu(menuItems: {
Text("Menu Item 1")
Text("Menu Item 2")
Text("Menu Item 3")
})
}
}
< /code>
It's not sensitive. You have to press hard to present it. I need to present it with a single touch like iOS Photo App's Add button. It is presented with a single touch.
How to show Menu with a single touch (not press)?
Подробнее здесь: https://stackoverflow.com/questions/652 ... oolbaritem
Мобильная версия