2015-07-28 62 views
0

我使用拉刷新與UICollectionView有一個標題(我不知道如果標題是相關的)。當我在刷新部分之前拉動刷新時,集合視圖跳下來(根本不流暢)。UICollectionView與標題拉刷新跳

可能是什麼問題?

這裏是我的代碼 -

- (void)addRefresh 
{ 
    self.refreshControl = [[UIRefreshControl alloc] init]; 
     [self.refreshControl addTarget:self action:@selector(reset) forControlEvents:UIControlEventValueChanged]; 
     [self.refreshControl setBackgroundColor:[UIColor whiteColor]]; 
     [self.profileCollectionView addSubview:self.refreshControl]; 
} 
- (void)reset 
{ 

    [self.refreshControl endRefreshing]; 
} 

回答

0

我有一個相似但不完全相同的問題UIRefreshControl其中文本將重疊UIRefreshControlUIActivityIndicator。這隻會在您第一次激活UIRefreshControl時發生。我不確定此修復是否會對您有所幫助,但您可以試試:

-(void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view from its nib. 

    //Fix for bug where spinner would overlap the text 
    dispatch_async(dispatch_get_main_queue(), ^{ 
     [_refreshControl beginRefreshing]; 
     [_refreshControl endRefreshing]; 
    }); 
}