【发布时间】:2014-11-19 11:03:40
【问题描述】:
我正在使用 UICollectionViewController 并尝试将项目设置为自动选择(即先前选择的选项)。如果我在设置单元格数据时尝试设置
def collectionView(view, cellForItemAtIndexPath: index_path)
//create the cell etc.. then
cell.selected = true
cell.update(index_path.row)
end
我得到 NoMethodError 选择。但是,这适用于正常的选择/取消选择方法。
def collectionView(view, didSelectItemAtIndexPath: index_path)
cell = view.cellForItemAtIndexPath(index_path)
cell.selected = true
end
关于如何自动预选单元格的任何想法?
谢谢,
【问题讨论】:
标签: rubymotion