2013-12-18 28 views
1

我想通過使用自定義單元格從EGOImageViewFrom here加載圖像。 出現我曾與LazyLoading通過EGOImageView不能使用自定義單元格

-(void)configureReviewCell:(YDRecentReviewCell*)mycell atindexpath:(int)indexPath 
{ 

    NSURL* url = [NSURL URLWithString: tempPlace.placeProfileImageUrlString]; 
    NSURL* bijUrl = [NSURL URLWithString: tempPlace.bizlogo]; 
EGOImageView* urlimage = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]]; 
    urlimage.delegate=self; 
    urlimage.imageURL = bijUrl; 

    mycell.topimage =urlimage; 

} 

但圖像沒有顯示錶視圖但是如果我將其添加爲對細胞內容查看一個子視圖上嘗試([mycell.contentView addsubView:url image])圖像。 我做錯了什麼。任何幫助,將不勝感激。

回答

2

請檢查該行

mycell.topimage = urlimage; 

確保topimage被添加作爲一個子視圖到了myCell的內容查看。

這似乎像FIX-

mycell.topimage = urlimage; 
[mycell.contentView addSubview:mycell.topimage]; 

我假定mycell.topimage是零分配任何urlimage它之前。 並且在此作業之前沒有將變量添加爲mycell.contentView的子視圖。

因此,您需要在分配後將此作爲子視圖添加到mycell.contentView。

+0

它給了我左上角的圖像 – Vikas

+0

因爲框架的原點是(0,0)。只需使框架正確。您需要這樣做: - ** myCell.topimage.frame = CGRectMake(10,10,80,80); **或您選擇的其他位置。 – Tarun

相關問題