【问题标题】:UICollectionView with header pull to refresh jumpsUICollectionView 与标题拉刷新跳转
【发布时间】:2015-10-19 00:37:53
【问题描述】:

我正在使用具有标题的 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];
}

【问题讨论】:

    标签: ios objective-c pull-to-refresh


    【解决方案1】:

    UIRefreshControl 的文本与UIActivityIndicatorUIActivityIndicator 重叠,我遇到了类似但不完全相同的问题。这只会在您第一次激活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];
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2013-09-08
      • 1970-01-01
      • 2014-07-09
      • 1970-01-01
      • 2013-01-22
      • 2020-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多