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
  • 相关阅读:
    layout布局
    窗口、easyui-window、easyui-panel、easyui-linkbutton
    FASTJSON
    Insert title here
    Insert title here
    Scala并发编程
    scala中java并发编程
    scala调用外部命令
    scala正则表达式
    scala占位符_的用法
  • 原文地址:https://www.cnblogs.com/fantasy3588/p/4744533.html
Copyright © 2011-2022 走看看