maxep / MXParallaxHeader

Simple parallax header for UIScrollView
MIT License
1.73k stars 251 forks source link

Strange bump when updating tableView on cell height #93

Closed Nexmind closed 5 years ago

Nexmind commented 6 years ago

Hello,

In a little app, i set the number of line of labels contained in my cell when touching it, and updates my tableView.

In a certain range of scrolling, i have some strange bump. The intensity of the bump depend of where i am in the range.

See the gif attached to a better comprehension.

This is the method i call when updating my tableView:

func showOrHideMoreText() {
    let angle: CGFloat = self.isExpanded ? (.pi / 2) * -1 : .pi / 2
    self.labelValue.numberOfLines = self.isExpanded ? 3 : 0
    UIView.animate(withDuration: 0.3, animations: {
        self.chevron.transform = self.chevron.transform.rotated(by: angle)
    })
    self.isExpanded = !self.isExpanded
}

And i simply use this in my didSelectRow:

   tableView.beginUpdates()
   cell.showOrHideMoreText()
   tableView.endUpdates()

iOS 11.3 and iPhone 7

GIF: expandedproblem

hendyevan commented 5 years ago

Hi @Nexmind , im getting this strange behaviour too when updating table view. Im temporary fixing this problem using tableView.scrollToRow(at: indexPath, at: .bottom, animated: true)

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.