Code Monkey home page Code Monkey logo

Comments (11)

LuKane avatar LuKane commented on May 12, 2024

我这边在 iPhone6s 和 iPhone12 上测试, 都没有出现卡顿现象!! 建议在真机上跑

from knphotobrowser.

wblzu avatar wblzu commented on May 12, 2024

我也是用iPhone 12运行的。IMController的数据源更换成网络图片,不要本地图片。然后点击tableview列表中的最后一张图,由此打开photobrowser,然后向右滑动翻页,显示数据源数组头部的图片,就会看到卡顿了。

from knphotobrowser.

LuKane avatar LuKane commented on May 12, 2024

可能是 IMController tableViewCell写的有问题, 若确定是Demo的问题, 则不回复你了! 若是 photoBrowser的问题, 我这边会做修改再回复你的!

from knphotobrowser.

LuKane avatar LuKane commented on May 12, 2024

Demo写的有问题罢了!!

from knphotobrowser.

wblzu avatar wblzu commented on May 12, 2024

不是的,在项目中用也有问题。我定位到了问题。只有这样修改才能避免翻页卡顿

  • (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
    // [cell prepareForReuse];

    KNPhotoItems *item = self.itemsArr[indexPath.row];
    // UIImageView *tempView = [self tempViewFromSourceViewWithCurrentIndex:indexPath.row];
    if (item.isVideo) {
    KNPhotoVideoCell *cell1 = (KNPhotoVideoCell *)cell;
    // [cell1 playerWithURL:item.url placeHolder:tempView.image];
    [cell1 playerWithURL:item.url placeHolder:item.sourceImage];
    if (_isNeedAutoPlay == true) {
    [cell1 setIsNeedAutoPlay:true];
    }
    [cell1 setPresentedMode:self.presentedMode];
    } else {
    KNPhotoBaseCell *cell1 = (KNPhotoBaseCell *)cell;
    // [cell1 sd_ImageWithUrl:item.url placeHolder:tempView.image photoItem:item];
    [cell1 sd_ImageWithUrl:item.url placeHolder:item.sourceImage photoItem:item];
    [cell1 setPresentedMode:self.presentedMode];
    }
    }

from knphotobrowser.

LuKane avatar LuKane commented on May 12, 2024

有没有考虑过 item.sourceImage 为空!

from knphotobrowser.

wblzu avatar wblzu commented on May 12, 2024

是会有这样的问题,但是这样修改之后至少它不卡了。我给你邮箱发调试视频吧,真的很卡的。

from knphotobrowser.

LuKane avatar LuKane commented on May 12, 2024

你这边别用 IMController 测试了, 用其他的Controller试试, 比如 第一个Controller, 不会出现卡顿现象

from knphotobrowser.

LuKane avatar LuKane commented on May 12, 2024

试了一下!! 你说的卡顿现象 只会在 低网速的时候 才会出现!
排查了一下原因: 是因为 根据网络图片的url 来获取 size, 这样会阻塞主线程!!
现在已经修改过了!! 更新一下新版本即可

from knphotobrowser.

wblzu avatar wblzu commented on May 12, 2024

大佬给力

from knphotobrowser.

elmaLin avatar elmaLin commented on May 12, 2024

我用的2.4.6版本滑动的时候也会卡,iPhone6s plus iOS11系统

  • (UIImageView *)tempViewFromSourceViewWithCurrentIndex:(NSInteger)currentIndex这个方法的确引起了卡顿

from knphotobrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.