Aleksander
Aleksander

Reputation: 2815

Autolayout updates view after it's been displayed

I'm having some issues with using AutoLayout for some pretty simple images and text. After the view has been displayed to the user, the image (and text) is resized and relocated on the screen. This gives the impression of the app being "laggy".

The (vertical) setup is quite simple:

-------------------------------HEADER-------------------------------
---Text1-----------------------Text2------------------------Text3---
---[                                                            ]---
---[                                                            ]---
---[                           IMAGE                            ]---
---[                                                            ]---
---[                                                            ]---

Have anyone experienced something similar using AutoLayout, and know how I can fix it? Or if you haven't, what would be the best way to correctly set up this (using StoryBoards) so it works across the different screen sizes?

Upvotes: 2

Views: 53

Answers (1)

lewis
lewis

Reputation: 3182

I had a similar problem and found that it was resolved by changing the constraints NOT to take into account the margins. It seems as though (sometimes?) the margins are calculated after the view is displayed which causes the jump. I have not had a problem with this generally, but it was certainly the problem in this instance.

enter image description here

Upvotes: 2

Related Questions