小编Tor*_*ink的帖子

UITableViewCell 删除滑动动画丑陋

我有以下问题。当我使用“滑动删除”从我的 UITableView 中删除 UITableViewCells 时,我看到了 UITableView 的丑陋行为。无论我在 deleteRows 方法中选择哪种动画,所有删除都会导致相同的奇怪行为。

这是我删除单元格的代码

func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
    if editingStyle == .delete {
        print("Deleted")

        self.tvItems.beginUpdates()

        if(indexPath.section == 0){
            Shoppingcart.shared.removeItemForId(ident: indexPath.row)
        }else if (indexPath.section == 1){
            Shoppingcart.shared.serviceContent.remove(at: indexPath.row)
        }

        if let parent = self.parent as? CollectionViewController{
            parent.collectionView?.reloadData()
        }
        self.tvItems.deleteRows(at: [indexPath], with: .fade)

        self.tvItems.endUpdates()

    }
}  
Run Code Online (Sandbox Code Playgroud)

这是损坏的动画的图像:

在此处查看损坏的动画

uitableview ios swift

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

如何使用forall循环将莲花脚本中的字符串与(##)连接起来?

我想用 forall 循环连接具有多个值的字符串,这里是代码:

varAttachmentNames = Evaluate( "@AttachmentNames" , doc )
Forall strAttachmentName in varAttachmentNames
    Set object = doc.GetAttachment( strAttachmentName )
    fileName = object.Name
End Forall
Run Code Online (Sandbox Code Playgroud)

在循环结束时,如果有多个文件,我希望它们的名称为 abc.pdf##xyz.pdf 都是文件名中的单独文件名 abc 和 xyz(字符串变量)

lotus-notes lotusscript domino-designer-eclipse

0
推荐指数
1
解决办法
237
查看次数