make UIView in UIScrollView stick to the top when scrolled up

前端 未结 4 1319
春和景丽
春和景丽 2020-12-08 11:49

So in a UITableView when you have sections the section view sticks to the top until the next section overlaps it and then it replaces it on top. I want to have a similar eff

4条回答
  •  感动是毒
    2020-12-08 12:27

    If I recall correctly, the 2010 WWDC ScrollView presentation discusses precisely how to keep a view in a fixed position while other elements scroll around it. Watch the video and you should have a clear-cut approach to implement.

    It's essentially updating frames based on scrollViewDidScroll callbacks (although memory is a bit hazy on the finer points).

提交回复
热议问题