UIImageView covers the entire UITableViewCell using the fill aspect

In the interface builder, I'm trying to prototype a cell with an image that spans the entire cell, but it doesn't work as expected.

As you can see in the following screenshot of my interface designer, I have an image view that spans the entire cell and is limited to each edge of the cell:

enter image description here

And actually so I expect him to look at the simulator, but instead I get the following:

enter image description here

Where, as you can see, it is not attached completely to the sides, and it can be difficult to see, but the image does go past the bottom of the cell (if you look hard enough, you can see the separator by hitting the bottom of the image.

This is really a buggy, and I really don't know what is going on.

+4
4

, Clip Subviews , .

enter image description here

, Content View.

enter image description here

, Clip Subviews Cell it Content, .

0

UIImageView .

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    //configure cell
    let imageView = UIImageView(frame: self.cell.frame)
    imageView.image = YOUR_IMAGE
    imageView.center = cell.center
    imageView.frame.size = cell.frame.size
    imageView.contentMode = .ScaleAspectFill
    cell.addSubview(imageView)
}

, .

0
  • , contentView. , . . , 0

enter image description here

  1. Clip Subviews (clipsToBounds) contentView imageView, , , , . Aspect Fit Scale To Fill
0

, .

uiimageview. .

enter image description here

0

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


All Articles