如何在從WebService獲取的ImageView中顯示圖像?從WebService獲取的顯示圖像
我能夠成功地檢索從服務形象的名稱,但不能設置在圖像中的ImageView
NSString *imgName = [students objectForKey:@"Image"];
NSLog(@"%@", imgName); **/* Image1.png */**
imgImage.image = [UIImage imageNamed:imgName];
的NSLog給出下面的控制檯輸出:
此搜索。 PNG
我無法設置圖像中的ImageView
你有這個名稱圖像添加到您的項目? – Anuj 2014-09-30 09:55:37
您必須檢查該圖像是否已添加到目標 – Anuj 2014-09-30 09:56:48
'imgImage.image = [UIImage imageNamed:imgName];' 此語句只會顯示圖像,如果它已添加到項目中。我認爲該圖片尚未下載到您的設備上。所以可能是圖像將被提取像這樣http://stackoverflow.com/questions/17318471/loading-images-in-background-to-optimize-the-loading-in-ios/17318655#17318655 – Dinesh 2014-09-30 09:58:31