在有TableView和ScrollView的界面中,點擊屏幕的Status Bar便可回到頂部,這是由於ScrollView的property scrollsToTop默認爲YES。ios
在蘋果文檔中特別強調app
On iPhone, the scroll-to-top gesture has no effect if there is more than one scroll view on-screen that has scrollsToTop set to YES.code
屏幕中有多個ScrollView或者其子類,此時點擊Status Bar不能返回頂部。
例如code4app網易新聞Demo在使用過程當中就出現了屏幕上包含多個ScrollView及其子類TableView的狀況。文檔
只設置一個ScrollView的scrollsToTop爲YES,其餘設置爲NOget