-
I tried to popup the menu on long press by using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Updated in 1.0.0-beta.2You can add message menus to display when a
MessageList(messages) { message in
// row content
MessageRow(message: message)
.padding(.top, 12)
} menuContent: { highlightMessage in
// menu content
MessageMenu {
Button("Copy", action: copy)
.buttonStyle(MessageMenuButtonStyle(symbol: "doc.on.doc"))
Divider()
Button("Reply", action: reply)
.buttonStyle(MessageMenuButtonStyle(symbol: "arrowshape.turn.up.right"))
Divider()
Button("Delete", action: delete)
.buttonStyle(MessageMenuButtonStyle(symbol: "trash"))
}
.padding(.top, 12)
} OldCurrently (1.0.0-beta.1), to use reversed list(the one that shows most recent entries at the bottom and auto-scrolls to the bottom), ZStack {
MessageRow(message: message)
Menu {
Button(action: copy) {
Label("Copy", systemImage: "doc.on.doc.fill")
}
Button(action: reply) {
Label("Reply", systemImage: "arrowshape.turn.up.right.fill")
}
Button(action: delete) {
Label("Delete", systemImage: "trash.fill")
}
} label: {
Color.clear
} primaryAction: {
}
} |
Beta Was this translation helpful? Give feedback.
Updated in 1.0.0-beta.2
You can add message menus to display when a
rowContent
(such asMessageRow
) is on long press gesture by settingmenuContent
parameter of theMessageList
initializer.MessageMenu
andMessageMenuButtonStyle
allow you to create message menu more easily. Here is an example: