12 2023 档案
98、swift--- tableView.dequeueReusableCell(withIdentifier: cellID, for: indexPath)
摘要:作用:复用cell.可以用标识符从表视图中获得可重用单元格.for: indexPath通过指定单元格位置获得可重用单元格,不需要判断. 用于 dequeue(出队)一个可复用的 cell,用于在 UITableView 或 UICollectionView 中显示。 这个方法接收两个参数: wit 阅读全文
posted @ 2023-12-04 16:49 强者VS弱者 阅读(69) 评论(0) 推荐(0) 编辑
97、Cell防止复用的两种方法
摘要:方法1 将获得cell的方法从- (UITableViewCell)dequeueReusableCellWithIdentifier:(NSString)identifier 换为-(UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)in 阅读全文
posted @ 2023-12-04 16:28 强者VS弱者 阅读(134) 评论(0) 推荐(0) 编辑
96、collectionViewCell防止复用的两种方法
摘要:第一种://在创建collectionView的时候注册cell(一个分区) UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@“cell" forIndexPath:indexPat 阅读全文
posted @ 2023-12-04 16:22 强者VS弱者 阅读(454) 评论(0) 推荐(0) 编辑


点击右上角即可分享
微信分享提示