I'm having no luck getting an image and its UIImageView
to show up the correct size in my custom UITableViewCell
. The image is correct, but its place in the UITableViewCell
is not, and isn't even close.
I don't have enough reputation points to post images sadly.
I have all the suggested constraints Xcode 6 added or suggested, but the image is showing up huge and in front of everything in my UITableViewCell
.
Here's the only code I have related 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'm using iOS 8, Xcode 6, and SDWebImage via CocoaPods. Any help would be appreciated, thanks!
Select your image view and modify the Content Mode as desired - perhaps Aspect Fit will scale it appropriately. If it appears positioned correctly but continues to extend outside the image view bounds, enable Clips to Bounds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With