小编uuu*_*uuu的帖子

更改 ContextMenu 中 UIImage 的弹出大小?

假设您有一个图像的上下文菜单,长按时会弹出该图像。如何使弹出窗口更大,但保持相同的尺寸?


ViewControllerTableViewCell: UITableViewCell, UIContextMenuInteractionDelegate {

func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
    UIContextMenuConfiguration(identifier: nil, previewProvider: nil)  { _ in
        let share = UIAction(title: "", image: UIImage(systemName: "")) { _ in
            // share code
        }
        return UIMenu(title: "", children: [share])
    }
}
Run Code Online (Sandbox Code Playgroud)
override func awakeFromNib() {
    super.awakeFromNib()
    immy.isUserInteractionEnabled = true
    immy.addInteraction(UIContextMenuInteraction(delegate: self))
}
Run Code Online (Sandbox Code Playgroud)

contextmenu uiimageview firebase swift uicontextmenuinteraction

2
推荐指数
1
解决办法
1755
查看次数