LargeTitles UIScrollView does not support multiple observers implementing _scrollViewWillEndDraggingWithVelocity:targetContentOffset

前端 未结 5 2439
执笔经年
执笔经年 2021-02-20 09:15

I have implemented large titles in my app with the following code:

if #available(iOS 11.0, *) {
            navigationController?.navigationBar.prefersLargeTitle         


        
5条回答
  •  清酒与你
    2021-02-20 09:52

    I found the solution. You have to set the first navigation controller to not use large titles.

    The point is that now UIScrollView has only one observer (navigationController) implementing _scrollViewWillEndDraggingWithVelocity.

    if (@available(iOS 11.0, *)) {
    
        self.navigationController.navigationBar.prefersLargeTitles = FALSE;
        self.navigationController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
    
    }
    

提交回复
热议问题