[英]How to show the full Image in Table view cell when we posted something Like Facebook
這是我的代碼:
cell.ImageViewPost.contentMode = UIViewContentModeScaleAspectFit;
cell.ImageViewPost.clipsToBounds = YES;
BaseURLIMG =[baseImageURl stringByAppendingString:[[ArrTotalResult valueForKey:@"post"]objectAtIndex:indexPath.row]];
[cell.ImageViewPost setImageWithURL:[NSURL URLWithString:BaseURLIMG] placeholderImage:nil];
我的圖像未完全顯示為單元格框架。 我們需要完全像Facebook帖子一樣顯示,其中發布的圖片以全視圖顯示。
確保imageViews框架是單元格的大小(或所需的大小)
嘗試將contentMode更改為UIViewContentModeScaleAspectFill
。 如果圖像仍然不是您想要的尺寸,則這是因為圖像的高寬比與imageView的高寬比不同,因此會發生某些裁剪。 要停止此操作,請使用UIViewContentModeScaleToFill
,它可以更改圖像的長寬比以匹配imageView,但可以使圖像變形。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.