View images in auto layout using SDWebImage in storyboards

I was not lucky to get the image and its UIImageView to display the correct size in my custom UITableViewCell . The image is correct, but its place in the UITableViewCell not and not even close.

I don't have enough reputation points to print images sadly.

I have all the proposed Xcode 6 restrictions added or proposed, but the image is huge and in front of everything in my UITableViewCell .

Here is the only code that I linked to it.

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]; } 

I am using iOS 8, Xcode 6 and SDWebImage through CocoaPods. Any help would be appreciated, thanks!

+5
source share
1 answer

Choose the image type and change the content mode as you like - perhaps the Aspect Fit will change it accordingly. If it displays correctly, but continues to go beyond the boundaries of the image, enable Clips to Borders.

0
source

Source: https://habr.com/ru/post/1206012/


All Articles