MJRefresh 使用注意點


1.使用上拉加載更多, 當數據加載完調用[ableView.mj_footer endRefreshingWithNoMoreData]方法顯示已經全部加載完畢這個方法,一定要放在[tableView.mj_footer endRefreshing];停止加載方法的后面,不然[ableView.mj_footer endRefreshingWithNoMoreData]這個方法會失效。

[Request requestGET:parameter view:nil urlPre:CourseCenterURL funItem:HuFuncItem_DiscoverCourseLibraryList success:^(NSDictionary *dic) {
        NSArray *dataListArray =  [HospitalShareRightModel mj_objectArrayWithKeyValuesArray:dic[@"data"][@"result"]];
        //下拉刷新
        if (weakSelf.pageNum == kPageNum) {
            [weakSelf.rightTableView.mj_header endRefreshing];
            [weakSelf.hospitalShareRightArray removeAllObjects];
            if (dataListArray.count <= 0) {
                [weakSelf.rightTableView removeFromSuperview];
                [weakSelf defauleView];
            }
        }
        [weakSelf.rightTableView.mj_footer endRefreshing];
        [weakSelf.hospitalShareRightArray addObjectsFromArray:dataListArray];
        if (dataListArray.count < 10) {
            [weakSelf.rightTableView.mj_footer endRefreshingWithNoMoreData];//放到停止加載方法后面 不然會失效
        }
        [weakSelf.rightTableView reloadData];


    } error:^(NSDictionary *dic) {
        
        [MBProgressHUD showError:dic[@"errmsg"]];
        
    } failure:^{
        

    }];


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM