Swift iOS Set scrollView constraint below navigation bar programmatically

前端 未结 5 1696
盖世英雄少女心
盖世英雄少女心 2021-01-01 15:20

My UIViewController is embedded in a navigation controller. I programmatically add the navigation buttons and now trying to add a scrollView below this navigation bar. The p

5条回答
  •  死守一世寂寞
    2021-01-01 15:46

    The only way I managed to get this working on iOS11 was like this

    if (@available(iOS 11.0, *)) {
        scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        // Fallback on earlier versions
    }
    

提交回复
热议问题