-1

I load a UIImageView with a certain height and width. after I initialise it, I would like to change it's height programmatically. I am using the following code to do so, but it is not working.

Note: The UIImageView has constraints set on it.

CGRect newframe = imageView.frame;
newframe.size.height= 500;
[imageView setFrame:newframe];

Calling setFrame is not changing anything on the image. What am I doing wrong?

Thanks

Kanan Vora
  • 224
  • 1
  • 9
Pacemaker
  • 1,117
  • 2
  • 17
  • 36

1 Answers1

1

Modify the height constraint after initializing your UIImageView instead. See the second answer here for an example: Change frame programmatically with auto layout

Community
  • 1
  • 1