ios - 在 iOS 中重新加载 tableview 部分时出现残像

标签 ios swift uitableview uicollectionview cell

您好,我正在尝试使用tableview及其单元格制作下拉菜单

我使用默认的tableviewcell作为菜单,使用自定义单元格作为内容

自定义单元格具有CollectionView,并且CollectionView具有其单元格

下拉和向上工作正常,但有像这样的残像

enter image description here

这是我选择菜单标题单元格(默认单元格)时的代码

    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: true)
        if indexPath.row == 0 {
            sectionDatas[indexPath.section].isOpended = sectionDatas[indexPath.section].isOpended ? false : true
            let sections = IndexSet(integer: indexPath.section)
            tableView.reloadSections(sections, with: .none)
        }
    }

有没有办法消除残影

最佳答案

尝试为 Collection View 设置clipToBounds = true或IsHidden - true/false(对于 Collection View )

关于ios - 在 iOS 中重新加载 tableview 部分时出现残像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49952463/

相关文章:

swift - 框架方法可访问性中的桥接 header

swift - 断言 viewController 是其 tableView 的委托(delegate)和数据源

php - 当附加到 NSMutableURLRequest 时,NSData 是什么格式?

ios - UITableView ScrollToRowAtIndexPath 方法不起作用

iphone - IOS日期选择器是否可以 're-skin'?

arrays - 如何从 url 数组中获取单个 url?

ios - 自动布局、屏幕旋转和 UIView 动画

ios - 如何在具有不同内容的 Controller 中多次使用自定义 UIView?

iphone - 为什么我无法删除 UITableView 的底行?

swift - 在应用程序之间切换时未调用 CellForRowAt(内部 gif)