【发布时间】:2014-12-28 17:41:12
【问题描述】:
我没有运气得到一张图片,它的 UIImageView 在我的自定义 UITableViewCell 中显示正确的大小。 图片是正确的,但它在 UITableViewCell 中的位置不是,甚至不接近。
遗憾的是,我没有足够的声望点来发布图片。
我已添加或建议了 Xcode 6 的所有建议约束,但 图像显示在我的 UITableViewCell 中的所有内容之前。
这是我唯一与之相关的代码。
ViewController.m
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 600.0;
NSString *imageURL = [NSString stringWithFormat:@"%@", standardResolutionLocal.url];
__weak UITableViewCell *wcell = api2Cell;
[wcell.imageView
sd_setImageWithURL:[NSURL URLWithString:imageURL]
placeholderImage:[UIImage imageNamed:@"320x180.gif"]
];
CustomTableViewCell.m
- (void)layoutSubviews {
[super layoutSubviews];
[self.imageViewPic setTranslatesAutoresizingMaskIntoConstraints:YES];
}
我通过 CocoaPods 使用 iOS 8、Xcode 6 和 SDWebImage。任何帮助将不胜感激,谢谢!
【问题讨论】:
-
你可以修复 UIImageView 的大小。
-
ImageView 内容模式 - 宽高比
标签: uitableview uiimageview storyboard sdwebimage