gpt4 book ai didi

ios - 通过 EGO ImageView 延迟加载不适用于自定义单元格

转载 作者:行者123 更新时间:2023-11-29 10:50:32 24 4
gpt4 key购买 nike

我正在尝试使用 EGOImageView 从 url 加载图像 From here通过使用自定义单元格。我试过

-(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;

}

但图像未显示在表格 View 中,但是如果我将其添加为单元格内容 View 的 subview ([mycell.contentView addsubView:url image])图像出现。我做错了什么。任何帮助将不胜感激。

最佳答案

请检查这一行

mycell.topimage = urlimage;

确保 topimage 作为 subview 添加到 mycell 的 contentView。

这似乎是解决方案-

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

我假定 mycell.topimage 在您为其分配任何 urlimage 之前为 nil。并且在此赋值之前没有变量作为 subview 添加到 mycell.contentView。

因此您需要在分配后将其作为 subview 添加到 mycell.contentView。

关于ios - 通过 EGO ImageView 延迟加载不适用于自定义单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20654713/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com