2016-05-08 38 views

回答

2

請試試這段代碼。收集視圖失去了我們的身高

self.colView.alwaysBounceVertical = YES; 
+0

請告訴我有關問題的問題 –

+0

老兄,這太棒了 –

0

您的代碼看起來不錯,只需在頂部移動tableview並在將其添加到collectionview之前設置一些框架即可。即使您的收藏視圖內容視圖的幀大小爲0,這也可以工作:

-(void)addPullToRefressToTableView { 

    UIView *refreshView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, 0, 0)]; 
    [self.tableView insertSubview:refreshView atIndex:0]; 

    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; 
    refreshControl.tintColor = [UIColor grayColor]; 
    [refreshControl addTarget:self action:@selector(reloadDatas) forControlEvents:UIControlEventValueChanged]; 
    NSMutableAttributedString *refreshString = [[NSMutableAttributedString alloc] initWithString:@"Pull To Refresh"]; 
    [refreshView addSubview:refreshControl]; 
}