Ios 带羊皮纸的奇怪的卷轴虫
我们最近决定尝试将羊皮纸应用到我们的应用程序中,因为它完全符合我们的需要。 我们还添加了一个折叠标题效果。 所以我们首先做了一个测试项目来测试它,就在我们将它重构到我们自己的应用程序中时,我们注意到了一个非常奇怪的错误,我们似乎无法找出问题所在。 起初,我们认为它可能存在于我们自己的应用程序中,但我打开了测试项目,它也在那里 此GIF将向您显示问题。当我们只有一个选项卡/屏幕时,情况更糟。如果不触发此问题,甚至很难向下滚动以正确刷新 有人知道为什么会发生这样的事情吗 羊皮纸实现的示例代码:Ios 带羊皮纸的奇怪的卷轴虫,ios,swift,parchment,Ios,Swift,Parchment,我们最近决定尝试将羊皮纸应用到我们的应用程序中,因为它完全符合我们的需要。 我们还添加了一个折叠标题效果。 所以我们首先做了一个测试项目来测试它,就在我们将它重构到我们自己的应用程序中时,我们注意到了一个非常奇怪的错误,我们似乎无法找出问题所在。 起初,我们认为它可能存在于我们自己的应用程序中,但我打开了测试项目,它也在那里 此GIF将向您显示问题。当我们只有一个选项卡/屏幕时,情况更糟。如果不触发此问题,甚至很难向下滚动以正确刷新 有人知道为什么会发生这样的事情吗 羊皮纸实现的示例代码: p
private var pagingViewController = PagingViewController()
pagingViewController.dataSource = self
pagingViewController.register(PagingCustomCell.self, for: CustomPagingItem.self)
addChild(pagingViewController)
pagingViewController.borderOptions = .hidden
pagingViewController.menuItemSize = .selfSizing(estimatedWidth: 100, height: 40)
pagingViewController.indicatorClass = CustomIndicatorView.self
pagingViewController.indicatorOptions = .visible(
height: 32,
zIndex: -1,
spacing: .zero,
insets: UIEdgeInsets(top: 0, left: 0, bottom: 5, right: 0)
)
pagingViewController.indicatorColor = .purple
pagingViewController.collectionView.contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
view.addSubview(pagingViewController.view)
pagingViewController.backgroundColor = .clear
pagingViewController.didMove(toParent: self)
pagingViewController.view.translatesAutoresizingMaskIntoConstraints = false
pagingViewController.view.snp.makeConstraints { (m) in
m.top.equalTo(headerView.snp.bottom)
m.left.right.bottom.equalToSuperview()
}
// Put shadow beneath tabs for collapsing header
pagingViewController.collectionView.layer.masksToBounds = true
pagingViewController.collectionView.layer.shadowOffset = CGSize(width: 0, height: 1)
pagingViewController.collectionView.layer.shadowRadius = 1
pagingViewController.collectionView.layer.shadowOpacity = 0.3
extension ViewController: PagingViewControllerDataSource {
func numberOfViewControllers(in pagingViewController: PagingViewController) -> Int {
return pages.count
}
func pagingViewController(_: PagingViewController, viewControllerAt index: Int) -> UIViewController {
let currentVc = pages[index]
if let currentVc = currentVc {
return currentVc
} else {
let tableViewVC = TableViewController()
tableViewVC.innerTableViewScrollDelegate = self
pages[index] = tableViewVC
return tableViewVC
}
}
func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem {
return CustomPagingItem(index: index, text: "View \(index+1)")
}
}
嗯,这不是一个真正的解决方案,但2.4.0版中似乎没有这个问题,所以回滚到该版本,问题就消失了。我将继续寻找未来的更新,看看它是否是固定的,然后然而