天天看點

scrollview向下偏移64解決方法

1.在所有的 viewController 裡都加上

這樣所有裝置下都是固定 64的位置開始。

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

    // 設定CGRectZero從導航欄下開始計算

    if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {

        self.edgesForExtendedLayout = UIRectEdgeNone;

    }

2.nav的第一個子視圖是scrollview的時候   系統才自動給scrollview加上64的inset

這偏移與第三方的下拉重新整理沖突

解決沖突 禁止系統偏移  vc.automaticallyadjustsScrollviewInsets =NO

nav.translucent   把原點下移64 和 ios6一樣  (一般不用這個)