iOS之UITableView(二)系统自带的刷新UIrefreshControl

来源:互联网 发布:mac 中文字幕乱码 编辑:程序博客网 时间:2024/05/12 03:58

- (void)creatRefreshing {

    self.refreshControl = [[UIRefreshControlalloc]init];

//    [self.tb addSubview:self.refreshControl];//可以不加这句话,系统自动管理UIRefreshControl,自动添加到tableview视图中;

    [selfsetRefreshControl:self.refreshControl];//tableviewcontroller控制器设置刷新控件 ,可以不设置

    self.refreshControl.attributedTitle = [[NSAttributedStringalloc]initWithString:@"努力加载中……"];

    self.refreshControl.tintColor = [UIColorblueColor];//小菊花颜色

    [self.refreshControladdTarget:selfaction:@selector(refreshAction)forControlEvents:UIControlEventValueChanged];

}


- (void)refreshAction{

    // 结束刷新

//    [self.refreshControl endRefreshing];

}


0 0
原创粉丝点击