UITableView scrolling is not smooth

前端 未结 6 608
囚心锁ツ
囚心锁ツ 2021-02-01 20:41

I have the smooth scrolling issue at my UITableView with UITableViewCell which contains UIImageView. Similar issues could be found all over the StrackOverflow but none of the pr

6条回答
  •  广开言路
    2021-02-01 21:02

    Maybe you could try SDWebImage instead. It is also a xamarin component which fashions an asynchronous image downloader and asynchronous memory and disk image caching with automatic cache expiration handling. Using it would probably mean throwing away a lot of hard written code, but it might be worth it -plus your code will become a lot simpler. In iOS you can also setup a SDWebImageManager inside the viewDidLoad of a controller:

    - (void)viewDidLoad{
    ...
    SDWebImageManager *manager = [SDWebImageManager sharedManager];
    manager.delegate = self;
    ...
    }
    

    and set the view controller as the delegate. Then, when the following delegate method is called:

    - (UIImage *)imageManager:(SDWebImageManager *)imageManager transformDownloadedImage:(UIImage *)image withURL:(NSURL *)imageURL
    

    you could scale your images to thumbs of the appropriate size before caching them.

    Hope that helps.

提交回复
热议问题