Open svetlanama opened 6 years ago
Hi,
Have a scroll UI issue when I use dynamically calculated heigh cells.
Initial RATreeView control setup
func setupTreeView() { treeView = RATreeView(frame: view.bounds) treeView.register(UINib(nibName: String(describing: EquipmentListCell.self), bundle: nil), forCellReuseIdentifier: String(describing: EquipmentListCell.self)) treeView.register(UINib(nibName: String(describing: EquipmentChildCell.self), bundle: nil), forCellReuseIdentifier: String(describing: EquipmentChildCell.self)) treeView.register(UINib(nibName: String(describing: EquipmentCollectionCellDetail.self), bundle: nil), forCellReuseIdentifier: String(describing: EquipmentCollectionCellDetail.self)) treeView.register(UINib(nibName: String(describing: EquipmentLevelCell.self), bundle: nil), forCellReuseIdentifier: String(describing: EquipmentLevelCell.self)) treeView.autoresizingMask = [.flexibleWidth, .flexibleHeight] treeView.delegate = self treeView.dataSource = self treeView.treeFooterView = UIView() treeView.estimatedRowHeight = 50 treeView.backgroundView = loadingView view.addSubview(treeView) }
For example, if I use just this everything is fine
func treeView(_ treeView: RATreeView, heightForRowForItem item: Any) -> CGFloat { return 50 }
But, I make different heights for the treeView and under the particular conditions - just hide the cells by setup height = 0. Here, I get a scroll issue
func treeView(_ treeView: RATreeView, heightForRowForItem item: Any) -> CGFloat { return stats.total.toInt() == 0 ? 0 : 50 }
Please review this video
Is there some way to fix this? Thanks!
did u solved this?
Hi,
Have a scroll UI issue when I use dynamically calculated heigh cells.
Initial RATreeView control setup
For example, if I use just this everything is fine
But, I make different heights for the treeView and under the particular conditions - just hide the cells by setup height = 0. Here, I get a scroll issue
Please review this video
Is there some way to fix this? Thanks!