Open zboralski opened 5 years ago
If minimumLineSpacing is set, every page has a gap and shifts to the right.
ASPagerNode without minimumLineSpace looks terrible and I am surprised no-one bumped into this issue.
This is the only solution I came up with that works:
override func viewDidAppear(_ animated: Bool) { super .viewDidAppear(animated) let spacing: CGFloat = 10.5 layout.minimumLineSpacing = spacing layout.itemSize = view.frame.size layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: spacing) node.view.frame = CGRect(x: 0, y: -spacing/2, width: view.frame.width + spacing, height: view.frame.height) node.scrollToPage(at: 1, animated: false)
and this only works if layout.minimumLineSpacing is originally set to zero!
The above solution doesn't work if I implement scrollViewDidScroll(_ scrollView: UIScrollView)
scrollViewDidScroll(_ scrollView: UIScrollView)
why?
If minimumLineSpacing is set, every page has a gap and shifts to the right.
ASPagerNode without minimumLineSpace looks terrible and I am surprised no-one bumped into this issue.
This is the only solution I came up with that works:
and this only works if layout.minimumLineSpacing is originally set to zero!