zoukankan      html  css  js  c++  java
  • tatableView 刷新

    1.一般情况下,刷新tableView,我们会直接调用reloadData方法   

        [self.tableView reloadData];

     但是有的时候我们需要刷新指定的cell和section,这个时候在调用reloadData的话,就浪费资源了。

    2.刷新局部的cell

     NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

     [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationFade];

    3.刷新局部的section

    NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:0];

     [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade];

    4.刷新动画

    typedef NS_ENUM(NSInteger, UITableViewRowAnimation) {

        UITableViewRowAnimationFade,

        UITableViewRowAnimationRight,           

        UITableViewRowAnimationLeft,

        UITableViewRowAnimationTop,

        UITableViewRowAnimationBottom,

        UITableViewRowAnimationNone,            

        UITableViewRowAnimationMiddle,          

        UITableViewRowAnimationAutomatic = 100  

    };

    1
  • 相关阅读:
    栈的操作总结
    C语言复习大纲
    生理周期
    石子合并
    幸运数字
    最长&最短文本
    C++引用
    C++入门
    直角三角形
    思维的囚徒--读书摘记和自己的肤浅解读--2021.1
  • 原文地址:https://www.cnblogs.com/fantasy3588/p/4744533.html
Copyright © 2011-2022 走看看