使用故事板中的SDWebImage在自动布局中的图像视图

SRM*_*RMR 5 storyboard uitableview uiimageview sdwebimage

我没有运气得到一个图像,它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"]
         ];
Run Code Online (Sandbox Code Playgroud)

CustomTableViewCell.m

- (void)layoutSubviews {
    [super layoutSubviews];
       [self.imageViewPic setTranslatesAutoresizingMaskIntoConstraints:YES];
}
Run Code Online (Sandbox Code Playgroud)

我通过CocoaPods使用iOS 8,Xcode 6和SDWebImage.任何帮助将不胜感激,谢谢!

Jor*_*n H 1

选择您的图像视图并根据需要修改内容模式 - 也许 Aspect Fit 会适当缩放它。如果它看起来位置正确但继续延伸到图像视图边界之外,请启用“剪辑到边界”。