小编use*_*966的帖子

UIRefreshController遍历UICollectionView

这是一个经常发生的错误,但并非总是如此.我有一个刷新控件添加到我的UICollectionView.当我刷新时,它完美地运作.但是,如果我半次刷新它甚至完全刷新,请转到应用程序中的另一个选项卡,然后返回,当我刷新时,UIRefreshControl出现在UICollectionView的一部分上.此外,它不是从零刷新微调栏开始,而是从所有加载开始(我已经在其他应用程序中注意到了这一点,但是,这很多是操作系统错误,但在操作系统应用程序中,微调器不会过去内容).以下是问题的图像:https: //www.dropbox.com/s/4qk6qjrdlapsvz0/IMG_0074.JPG以下是我在ViewDidLoad中设置RefreshController的方法.

refreshControl = [[UIRefreshControl alloc] init];

[refreshControl addTarget:self action:@selector(refresh2)

forControlEvents:UIControlEventValueChanged];

[self.collectionView addSubview:refreshControl];

self.collectionView.alwaysBounceVertical = YES;
Run Code Online (Sandbox Code Playgroud)

任何人都知道如何让微调器在CollectionViewController后面?谢谢

objective-c ios uicollectionview uirefreshcontrol

12
推荐指数
1
解决办法
2653
查看次数

UICollectionView在滚动时重新加载错误的图像

在下面的代码中,我从文本文件下载图像URL,将其存储在NSMutableArray中,然后从CellforItemAtIndexPath中的这些URL下载图像.但是,当我向上和向下滚动片刻时,错误的图像位于错误的位置.它纠正了一秒钟,但我想摆脱滚动问题.这是代码:

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *identifier = @"Cell2";

    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
    AsyncImageView *recipeImageView = (AsyncImageView *)[cell viewWithTag:100];
    UILabel *titleView = (UILabel *)[cell viewWithTag:101];
    titleView.numberOfLines = 3;
    UIImageView *overlay = (UIImageView *)[cell viewWithTag:111];
    FXBlurView *blurView = (FXBlurView *)[cell viewWithTag:110];
    blurView.tintColor = [UIColor colorWithRed:51.0 green:51.0 blue:51.0 alpha:1];


    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
        hi = [self videoTitle];
        images = [self firstPhoto];
        // switch to a background thread and perform your expensive operation


        // switch back to the main …
Run Code Online (Sandbox Code Playgroud)

ios afnetworking uicollectionview

9
推荐指数
2
解决办法
4849
查看次数

更改字体大小以适合UITextView

我在Storyboard中设置了UITextView.它设置为定义的大小.我希望能够根据文本的大小来更改字体的大小.用户无法编辑文本视图,只需更新一次.知道怎么做吗?

uitextview ios

3
推荐指数
2
解决办法
4477
查看次数