0

Im using auto layout for this imageView and I don't have a height set in the constraints thinking it would resize to the image height but it doesn't seem to work. Here is a pic:

http://imgur.com/JtpTKVx

I want to remove the red space which is the background and just have the image

it is in a UITableViewCell which i want to size according to the image size.

Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119
farhan
  • 233
  • 1
  • 13

2 Answers2

0

There isn't a way to do this declaratively. You'll have to calculate how high the UIImageView needs to be based on your image dimensions, then set the height of the UIImageView in code, either by setting the frame height as described here, or by adding a height constraint and setting its constant to your desired height.

Community
  • 1
  • 1
Brett Donald
  • 6,745
  • 4
  • 23
  • 51
0

you are put uiview and set background color white and set frame same to uitableviewcell and in put image UIView.

Bhadresh Kathiriya
  • 3,147
  • 2
  • 21
  • 41