在創(chuàng)建時(shí)tableView 或 collectionView 時(shí)加入下面的代碼即可 self.automaticallyAdjustsScrollViewInsets = NO;