答案 0 :(得分:1)
在此处选择长按messageBubble时会出现的内容。
var cont = window.parent.document.getElementById('container');
cont.style.display='none';
然后选择所需项目后会发生什么,
override func collectionView(_ collectionView: UICollectionView, canPerformAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?) -> Bool {
if (action == #selector(UIResponderStandardEditActions.copy(_:))) {
if(messages[indexPath.row].isMediaMessage) {
return false
} else {
return true
}
}
if (action == #selector(UIResponderStandardEditActions.cut(_:))) {
if(messages[indexPath.row].isMediaMessage) {
return false
} else {
return false
}
}
if (action == #selector(UIResponderStandardEditActions.paste(_:))) {
if(messages[indexPath.row].isMediaMessage) {
return false
} else {
return false
}
}
if (action == #selector(UIResponderStandardEditActions.delete(_:))) {
if(messages[indexPath.row].isMediaMessage) {
return true
} else {
return true
}
}
return super.canPerformAction(action, withSender: sender)
}
}
答案 1 :(得分:0)
使用
cell.textView.selectable = false
在cellForRow
方法