2016-05-08 36 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]; 
}