zoukankan      html  css  js  c++  java
  • v2ex 下拉刷新模块


    https://github.com/singro/SCPullRefresh


    self.tableHeaderView = [[UIView alloc] initWithFrame:(CGRect){0, 0, kScreenWidth, 0}];


    关于viewDidLoad 和 loadView

    http://stackoverflow.com/questions/573958/iphone-sdk-what-is-the-difference-between-loadview-and-viewdidload


    导航+UITableView,在push,back回来之后,当前cell仍然是选中的状态。
    当然,解决办法简单,添加一句[tableView deselectRowAtIndexPath:indexPath animated:YES]即可。
    令人纠结的时,在没加这句的时候,有的视图同样回来之后,选中状态消失,为什么会出现这种情况呢?
    原来是,如果UITableView是在UITableViewController中时,就会默认取消,而如果是在UIViewController时,需要添加这一句,不过有时即使前者也需要添加,那是因为在视图加载时有其它功能代码,具体情况各异。所以后者必须加,前者可能需要加。

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        
        [self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
        
    }


    为什么要delegate = nil

     http://stackoverflow.com/questions/15016348/set-delegates-to-nil-under-arc

    - (void)dealloc {
        
        self.tableView.delegate = nil;
        self.tableView.dataSource = nil;
        
        [[NSNotificationCenter defaultCenter] removeObserver:self];
        
    }


    - (void)viewWillLayoutSubviews {
        
        [super viewWillLayoutSubviews];
        
        self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(self.tableViewInsertTop, 0, self.tableViewInsertBottom, 0);
        NSLog(@"%s",__func__);
        
    }
    2015-08-26 12:20:32.298 SCPullRefresh[79798:1946898] -[SCPullRefreshViewController viewWillLayoutSubviews]
    2015-08-26 12:20:32.306 SCPullRefresh[79798:1946898] -[SCPullRefreshViewController viewWillLayoutSubviews]

    调用了两次。


     指定滚动条在scrollerView中的位置

    http://www.cnblogs.com/woainilsr/archive/2012/03/28/2421881.html

    self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(self.tableViewInsertTop, 0, self.tableViewInsertBottom, 0);
    UIEdgeInsetsMake 逆时钟,上左下右

    @property (nonatomic, copy) void (^loadMoreBlock)();


    
    
    
    
    
    
    
    
    
    
     
  • 相关阅读:
    ASP.NET配置文件Web.config 详细解释
    Firefox 3.6最新功能:网页可根据设备方位调整角度
    ascx + wrapper page + jQuery的Ajax解决方案
    C#中常用的文件操作方法
    Excel鲜为人知的35招秘技
    NHibernate.Search 基于Lucene.NET的全文索引
    Firefox和IE之间7个JavaScript的差异
    .net2.0使用json的知识,要点,问题和解决方案
    服务器响应HTTP的类型ContentType大全
    欢迎Clonezilla,再见Symantec Ghost
  • 原文地址:https://www.cnblogs.com/pencilCool/p/4759227.html
Copyright © 2011-2022 走看看