我正在使用SDWebImage组件为Xamarin.ios应用程序下载异步映像。在这里,我面临的问题是不能使用下面的代码/方法,这已经采取了SDWebImage组件官方网站。检查链路
SDWebImageManager.SharedManager.Download (
url: new NSUrl ("http://db.tt/ayAqtbFy"),
options: SDWebImageOptions.CacheMemoryOnly,
progressHandler: (recievedSize, expectedSize) => {
// Track progress...
},
completedHandler: (image, error, cacheType, finished) => {
if (image != null) {
// do something with the image
}
}
);我得到问题/错误的地方是progressHandler和completedHandler参数。以下是我的实际错误:
Error CS1739: SDWebImage.SDWebImageDownloader.DownloadImage(Foundation.NSUrl,SDWebImage.SDWebImageDownloaderOptions的最佳重载方法匹配,SDWebImage.SDWebImageDownloaderProgressHandler,SDWebImage.SDWebImageDownloaderCompletedHandler)‘不包含名为`progressHandler’的参数
发布于 2016-04-12 23:14:06
通过检查“下载”方法,我发现现在的参数是不同的。您需要这样更改代码块:
SDWebImageManager.SharedManager.Download (
url: new NSUrl ("http://db.tt/ayAqtbFy"),
options: SDWebImageOptions.CacheMemoryOnly,
progressBlock: (recievedSize, expectedSize) => {
// Track progress...
},
completedBlock: (image, error, cacheType, finished, imageUrl) => {
if (image != null) {
// do something with the image
}
}
);如果您注意到,"progressHandler“和"completedHandler”分别改为"progressBlock“和" completedBlock”,而completedBlock需要一个新的参数"imageUrl“。
https://stackoverflow.com/questions/34222910
复制相似问题