iPhone - how to scroll two UITableViews symmetrically

前端 未结 5 1403
天命终不由人
天命终不由人 2021-01-01 05:27

In my app, I have two tableViews side by side. When the user scrolls on, I would like the second one to scroll at the same time, so it looks almost like one table with two d

5条回答
  •  渐次进展
    2021-01-01 06:02

    in swift scroll two uitableviews symmetrically:

    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        if tb_time1 == scrollView {
            tb_time2.contentOffset = tb_time1.contentOffset
        }else if tb_time2 == scrollView {
            tb_time1.contentOffset = tb_time2.contentOffset
        }
    }
    

提交回复
热议问题