3

I have few views on a view controller. I am updating their positions thorough constraints, but the app is always showing me the previous positions of the views.

After deleting the constraints, it is still showing me the previous positions. Please tell me how I can get rid of this problem.

jscs
  • 63,694
  • 13
  • 151
  • 195
TechChain
  • 8,404
  • 29
  • 103
  • 228

1 Answers1

0

I am updating their positions thorough constraints? what do you mean? maybe you update constraint constant? you don't forgot add ?

[self.view layoutIfNeeded];

or if you simply change constrain in Interface builder you have warning like this

enter image description here

you should tap to warning, and you can see this

enter image description here

tap to update constraint and all be ok))

P.S every time, when you change constraint in IB and you have warning you should tap to update constraint.

Joe Hallenbeck
  • 1,452
  • 12
  • 24
  • Well you are right i updated the constraint as well & i didn't get such warning.Actually it was an image size issue.I was adding an image on ImageView of small size but when i replaced the image of big size after that i started getting this issue.So i replaced with old image. – TechChain Aug 01 '15 at 04:05
  • ok lets talk....what constraint for uiImageView you have? and how you add image in image view? – Joe Hallenbeck Aug 01 '15 at 10:18
  • I had constraints for width ,height,leading space,top space.@joe – TechChain Aug 01 '15 at 10:37
  • how you add image? and what "mode"(scale to fill or aspect fit.... ) for image in image view you use? – Joe Hallenbeck Aug 01 '15 at 10:39
  • and for example you have image view 200x200 you add image into image view - all ok, and then you add another image in this imageView you have to see previous image? I correctly understood your question? – Joe Hallenbeck Aug 01 '15 at 10:47
  • Yes i add another image of large size then all things messed up. – TechChain Aug 01 '15 at 10:51
  • have you got acc in linked? or Facebook? – Joe Hallenbeck Aug 01 '15 at 10:52
  • No but why you need those – TechChain Aug 01 '15 at 10:54
  • Give me the part of project or project, if you aren't afraid, and i will try to help you and i can explain, what problem you have, there are many reason to have this issue, it is very difficult to understand without seeing a code. – Joe Hallenbeck Aug 01 '15 at 10:57