Shrink large title when scrolling (not UITableViewController) iOS 11

前端 未结 12 1766
太阳男子
太阳男子 2020-12-10 02:35

I have got a View Controller embedded in a Navigation Controller with prefers large titles option set to true; inside the View Controller there’s a Scroll View.

I wa

12条回答
  •  余生分开走
    2020-12-10 02:56

    In case someone needs to have some view on top, like a menu, and then a UITableView/UICollectionView, and the large title is not hiding when scrolling, like in this "awesome" picture I made:

    You will need to set up all the required constraints for the UIView & for your UITableView/UICollectionView, but the most vital part is:

    make sure your UITableView/UICollectionView is the first subview, and then the UIView or any other views are behind.

    Here is an example of that:

提交回复
热议问题