1
該代碼位於單元初始化例程中,該例程設置自定義單元的元素。它異步地從網上獲取圖像。但是一旦完成,我需要重新繪製它。異步獲取圖像並設置setNeedsDisplay
這是我的代碼片段:
dispatch_async(myCustomQueue, ^{
//Look for the image in a repository, if it's not there
//load the image from the web (a slow process) and return it
mCover.image = [helperMethods imageManagerRequest:URL];
//Set the image to be redrawn in the next draw cycle
dispatch_async(dispatch_get_main_queue(), ^{
[mCover setNeedsDisplay];
});
});
但不重繪的UIImageView。我試圖重繪整個單元格,但這也不起作用。非常感謝您的幫助。我一直在試圖解決這個問題一段時間!
你返回一個UIImage或UIImageView的?也許你無意中將圖像分配給圖像視圖? – Dave