0
我想水平滾動到一個collectionView,當我調用一個函數,並收到錯誤「無」不可用:使用[]來構造一個空的選項集 - 不知道這裏有什麼問題。 ..提前致謝!水平滾動收藏查看期號
func handleSearch() {
scrollToMenuIndex(menuIndex: 2)
}
func scrollToMenuIndex(menuIndex: Int) {
let indexPath = NSIndexPath(item: menuIndex, section: 0)
collectionView?.scrollToItem(at: indexPath as IndexPath, at: .none, animated: true)
}
閱讀'UICollectionViewScrollPosition'的文檔。請注意缺少'none'值。 – rmaddy