首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏Elton的技术分享博客

    UITableView reloadData或viewWillAppear失效

    今天在做开发的时候,忽然发现在视图的viewWillAppear:方法中添加: [self.tableView reloadData]; 不起作用,viewWillAppear:这个方法根本没有调用 后来发现原来用了 willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { [self.myTableView reloadData

    71330发布于 2021-01-22
  • 来自专栏KyXu

    【iOS 开发】tableView updates 对比 reloadData

    tableData.append("\(tableData.count)") tableData.append("\(tableData.count)") tableView.reloadData 总结 numberOfRows 方法调用: 都只调用一次 numberOfRows 方法 cellForRow 方法调用次数: reloadData 会为当前显示的所有cell调用这个方法,updates 只会为新增的cell调用这个方法 cellForRow 方法调用时间: reloadData 会在 numberOfRows 方法调用后的某一时间异步调用 cellForRow 方法,updates 会在 numberOfRows 方法调用后马上调用 cellForRow 方法 reloadData 方法缺陷: 带来额外的不必要开销,缺乏动画 updates 方法缺陷:deleteRows 不会调用

    2.1K30发布于 2019-04-11
  • 来自专栏西二旗一哥

    Some problems with refresh UICollectionView

    flash on the screen Sometiems you may find your collectionView has a phenomenon of flash when you call reloadData cells is in layoutSubviews method, as layoutSubViews will be called in the next runloop after call reloadData You may call layoutSubViews manually as followed: //BUG: [self.collectionView reloadData]; //Solution : [self.collectionView reloadData]; [self.collectionView setNeedsLayout]; [self.collectionView You may have the problem with text flash when you call collectionView's reloadData method github link

    2.3K30发布于 2018-09-30
  • 来自专栏前端资源

    Vue中使用setTimeout()定时器延迟执行方法不生效的原因及解决

    示例: setTimeout(function () {   this.closeModal()   list.api.reloadData(); },2000) 直接使用上面的代码执行 closeModal setTimeout() 方法,应该使用下面的代码: const that = this; setTimeout(function () {   that.closeModal()   list.api.reloadData 代码如下: setTimeout(function () {   list.api.reloadData(); },2000) 以上,希望对您有所帮助。

    9K10发布于 2020-02-24
  • 来自专栏落影的专栏

    UICollectionView iOS 13以下删除动画crash

    但是这个reloadData并不会直接触发UICollectionView马上从dataSource和delegate去获取数据和UI,而是会等到UICollectionView展示的时候再进行触发。 问题修复 区分UICollectionView删除cell场景,如果是用户手动移除则会进行动画;如果是非手动触发删除则直接调用reloadData,不调用deleteItemsAtIndexPaths。 如下: [UICollectionView] Performing reloadData as a fallback — Invalid update: invalid number of items [self.collectionView reloadData]; NSLog(@"count1:%d", [self.collectionView numberOfItemsInSection:0]) [self.collectionView reloadData]; ... ...

    2.2K30编辑于 2022-09-19
  • 来自专栏Rindew的iOS技术分享

    iOS实现三列表格点选(附Demo)

    :two0]; //三维数组 [self.dropView.thirdData addObject:third0]; } [self.dropView reloadData ]; [self.rightTableView reloadData]; }else if (tableView == self.midTableView) { self.IndexPathArray[1] = [NSString stringWithFormat:@"%ld", indexPath.row]; [self.rightTableView reloadData NSString stringWithFormat:@"%ld",indexPath.row]; //刷新3列 [self.leftTableView reloadData ]; [self.midTableView reloadData]; [self.rightTableView reloadData];

    1.2K30发布于 2018-06-14
  • 来自专栏日常技术分享

    iOS UITableView 无数据占位图

    BOOL)enableScrollWhenPlaceHolderViewShowing; @end @interface UITableView (PlaceHolder) - (void)d_reloadData self, @selector(placeHolderView), placeHolderView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - (void)d_reloadData { [self reloadData]; [self d_checkEmpty]; } - (void)d_checkEmpty { BOOL isEmpty = YES; self.placeHolderView = nil; // 设置TableView 可滚动 self.scrollEnabled = YES; } } @end 使用时候只要调用d_reloadData

    1.7K20发布于 2019-01-28
  • 来自专栏iOS 开发

    UICollectionView 连续插入分区刷新问题

    } } } else { self.collectionView.reloadData } } } else { self.collectionView.reloadData

    1K20发布于 2021-03-05
  • 来自专栏万岳科技那些事儿

    直播卖货小程序源码中,商品分类页面是如何实现的

    判断滑动是不是因为点击一级分类引起         isClickLeft = YES;         selectTableIndex = indexPath.row;         [tableView reloadData         ///更新当前选中的一级分类的indexpath         selectTableIndex = indexPath.section;         [_classTableView reloadData         ///更新当前选中的一级分类的indexpath         selectTableIndex = indexPath.section;         [_classTableView reloadData

    1.6K20发布于 2020-07-22
  • 来自专栏日常技术分享

    iOS 给Tableview 没有数据的时候添加占位图

    property (nonatomic, weak, nullable) id <DTableViewPlaceHolderDelegate> placeHolderDelegate; - (void)d_reloadData selector(placeHolderDelegate), placeHolderDelegate, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } - (void)d_reloadData { [self reloadData]; [self d_checkEmpty]; } - (void)d_checkEmpty { BOOL isEmpty = YES; DTableViewPlaceHolderDelegate self.tableView.placeHolderDelegate = self; // 刷新数据调用 [self.tableView d_reloadData

    1K20发布于 2021-07-21
  • 来自专栏陈满iOS

    iOS·下载管理第三方框架初步调研

    dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{ [wkself.tbView reloadData MCDownloadManager defaultInstance] removeWithURL:self.urls[indexPath.row]]; [self.tableView reloadData ]; [[MCDownloader sharedDownloader] remove:receipt completed:^{ [self.tableView reloadData

    1.1K20发布于 2018-10-09
  • UITableView的原理——探究及重新实现代码

    nonatomic, strong) NSArray *dataSource; // 假设数据源为数组@property (nonatomic, assign) CGFloat rowHeight;- (void)reloadData reusableCells = [NSMutableArray array]; _rowHeight = 44.0; } return self;}// 加载数据并展示- (void)reloadData @"Row 3", @"Row 4", @"Row 5"]; [self.view addSubview:tableView]; // 重新加载数据 [tableView reloadData 数据渲染:在 reloadData 方法中,我们遍历数据源,生成并配置每一个单元格(MyTableViewCell),然后将它们添加到 MyTableView 的视图层级中。

    28910编辑于 2025-07-18
  • 来自专栏三掌柜的技术空间

    iOS开发:UICollectionViewCell删除的实现方法

    deselectItemAtIndexPath:indexPath animated:YES]; _selectedIndexPath = indexPath; // 赋值 [_collectionView reloadData recognizer.view.tag]; //删除数据源 [_collectionView deleteItemsAtIndexPaths:@[indexPath]]; //删除操作 [_collectionView reloadData

    2.6K41编辑于 2021-12-03
  • 来自专栏jeremy的技术点滴

    利用promise实现简单的前端cache

    return cache; }); } else { return Promise.resolve(cache); } }; //再定义了一个重新加载数据的方法 var reloadData data){ return data.statusText; }); } //否则返回已经存在的promise对象 return loadPromise; }; var reloadData //如加载过程出现异常,则记录rejected状态 loadRejected = true; }); } return loadPromise; }; var reloadData

    1.6K40发布于 2018-05-10
  • 来自专栏月亮与二进制

    《Motion Design for iOS》(三十八)

    如果数据返回了并且我调用了[self.tableView reloadData],它会立即出现并且对用户可见。 然后我会调用[self.tableView reloadData]将数据加载到列表行中去,这时候所有的行都在它们正常的位置上,但因为整个列表透明度为0并且是隐藏的,屏幕上什么都看不见。 // 将列表变为不可见,重载数据 self.tableView.alpha = 0.0f; [self.tableView reloadData]; // 存储一个时间变量,这样我就可以调整每行动画之间的延迟时间

    75220发布于 2021-11-23
  • 来自专栏iOS开发攻城狮的集散地

    iOS UITableView获取特定位置的cell

    currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:indexPath.section]; [_leftTableView reloadData currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:indexPath.section]; [_leftTableView reloadData

    5.8K80发布于 2018-05-23
  • 来自专栏戴铭的博客

    使用ReactiveCocoa开发RSS阅读器

    监听列表数据变化进行列表更新 [RACObserve(self, feeds) subscribeNext:^(id x) { @strongify(self); [self.tableView reloadData feedModel.title,(unsigned long)self.fetchingCount,(unsigned long)self.feeds.count]; [self.tableView reloadData { //加载更多 self.listData = x; } //刷新 [self.tableView reloadData

    89010发布于 2020-06-16
  • 来自专栏iOS开发~

    iOS_折叠展开 FoldTextView

    return [config] }() // 4.3 add to super view self.view.addSubview(self.tableView) self.tableView.reloadData MOOTableViewCellDelegate { func mooCellShouldReloadData(_ cell: UITableViewCell) { self.tableView.reloadData

    74640编辑于 2023-11-20
  • 来自专栏谈补锅

    UITableView增加和删除、移动

    [self.arrays[indexPath.section] removeObjectAtIndex:indexPath.row]; // [tableView reloadData [self.arrays[indexPath.section] removeObjectAtIndex:indexPath.row]; // [tableView reloadData

    2.5K30发布于 2018-09-27
  • 来自专栏码客

    Android 自带的下拉刷新SwipeRefreshLayout

    延迟发送消息 就好了 //定义消息常量 interface ZJHandlerStatus { int endrefresh = 0; int endDialog = 1; int reloadData mSwipeLayout.setRefreshing(false); break; case ZJHandlerStatus.reloadData

    4.6K10发布于 2019-10-22
领券