2011-11-15 26 views

回答

2

當然可以。只需在表格視圖的數據源中實現幾個方法:-sectionIndexTitlesForTableView:(應該返回標題數組)和-tableView:sectionForSectionIndexTitle:atIndex:,當用戶單擊某個節標題時,它將返回相應的節。

+0

它只在我打開搜索框時顯示。我想要得到這個:(第二張圖片)http://stackoverflow.com/questions/6994480/scroll-to-tableviewheader-using-tableviewsectionforsectionindextitleatindex – BlockReader

+0

聽起來就像你將代碼添加到錯誤的視圖控制器,然後。 –