繼承自CollectionViewController的菜單控制器:BINMenuController
成為“BINMenuController”的子類,實現重寫兩個數據源方法(必須重寫!!!)
/**
- 返回在分組中的個數,子類中必須要實現 */
- (NSInteger)numberOfItemsInCollectionViewController;
/**
- 子類需實現這個方法來設置Cell 的相關屬性 */
- (void)customizeCell:(BINCollectionViewCell *)cell forRow:(NSInteger)row;
至于創建示例代碼如下: BINCollectionViewLayout * layout = [[BINCollectionViewLayout alloc] init]; BINCollectionViewController * viewController = [[BINCollectionViewController alloc] initWithCollectionViewLayout:layout]; layout.delegate = viewController;
若使用storyboard 或者 xib 創建 只需類型綁定即可。 之前問題已經修復,是我自己粗心大意了,謝謝大家提意見
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!