
注意:我使用的是UItableVIEwautomaticDimension
[_imageVIEwSharedImage sd_setimageWithURL:[NSURL URLWithString:[_popUpManager.popUpDetails valueForKey:@"photo"]] placeholderImage:[UIImage imagenamed:@"placeholderBackground"] options:SDWebImageProgressiveDownload completed:^(UIImage *image,NSError *error,SDImageCacheType cacheType,NSURL *imageURL){ UIImage *croppedImage=[Util adjustimageSizeWhenCropPing:image]; [_imageVIEwSharedImage setFrame:CGRectMake(_imageVIEwSharedImage.frame.origin.x,_imageVIEwSharedImage.frame.origin.y,croppedImage.size.wIDth,croppedImage.size.height)]; [_imageVIEwSharedImage setimage:croppedImage]; [self setNeedsLayout]; [self updateConstraintsIfNeeded];}];解决方法 使用UItableVIEwautomaticDimension时,必须为单元格内容视图中的所有项目从上到下指定自动布局约束.希望你已经做到了. 在使用自动布局时,您应该注意不要调整框架.如果您想这样做,请使用约束来执行此 *** 作.为imageVIEwSharedImage设置高度约束和宽度约束的出口,并将其常量设置为所需的值.
_imageVIEwHeightConstraint.constant = croppedImage.frame.size.height;_imageVIEwWIDthConstraint.constant = croppedImage.frame.size.wIDth;
然后调用layoutIfNeeded.
总结以上是内存溢出为你收集整理的ios – 滚动时使用UITableViewAutomaticDimension按照下载的图像高度调整自定义表格单元格高度全部内容,希望文章能够帮你解决ios – 滚动时使用UITableViewAutomaticDimension按照下载的图像高度调整自定义表格单元格高度所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)