Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll UI issue that has persisted for a while. #250

Open
svetlanama opened this issue Feb 4, 2018 · 1 comment
Open

Scroll UI issue that has persisted for a while. #250

svetlanama opened this issue Feb 4, 2018 · 1 comment

Comments

@svetlanama
Copy link

svetlanama commented Feb 4, 2018

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!

@fukemy
Copy link

fukemy commented Jan 18, 2022

did u solved this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants