Window keeps reverting to an earlier size

Greetings.

I have a window with a tabbed view in it, that for some time I had a certain height. More recently, I have added more items within the tabbed view, and have thus needed to increase its height.


Ever since I increased the height, however, whenever I close Xcode and reopen it (including over restarts), or even close the .xib it's in and reopen it, the window and tabbed view revert to their earlier size, thus necessitating both resizing them and fixing the positions and sizes of several of the controls within the tabbed view.


I have even committed the fixed .xib to the Git repository, and reverted the changes that are apparently being made automatically, but if each time I reopen the .xib, it still shrinks it, and if I try it while it's open, it doesn't even seem to take effect, as it keeps the smaller size.


Could this be due to something I accidentally asked Xcode to do before I made the size change?


Any assistance on getting this window to stay the size I put it would be most appreciated.


Timothy Collett

In such situation I try to delete derived data.

Well, I have now tried this, and it doesn't seem to make any difference, sadly.


It was a good thought, though. Thanks.


Timothy Collett

So, check the constraints ; you may have set some vertical sizes or distances that force the window size.


For instance, if you have 3 objects.

For each you force its height and the distance with the one below.

If you have set the top space to superview for the one at top

and set the bottom space to superview for the one at the bottom,


then you nhave de facto set the window height,.


To check, try in editor menu to resolve auto layout issues by updating the frames, just to see what happens.

Part of why it's been so frustrating to me is that I managed to get all the layout inconsistencies fixed, and have resizing the window only grow the stuff I wanted to let grow.


So yeah, that was the first thing I thought of. Every time it does this, it reintroduces several inconsistencies.


I will give it a triple-check tomorrow, to make sure that there's nothing it's just failing to show me.


Timothy Collett

Where does the problem appear ? In Interface Builder when you open the window ? Or at run time ?


If it is in IB, have you checked how the window size is defined ?

Well, other things diverted me from getting back to this till now, but I did try this again—fixing every single layout inconsistency—and once I had done so, the window size no longer reverted after closing and reopening!


Oddly, though, some of the more minor constraints still seem to be changing themselves. So while the most salient symptom has been resolved, the underlying problem appears to still be happening, and I can't account for it.


Thank you for your help, though!


Timothy Collett

Is your window restorable? Do you want to persist the window size between launches or no?


Are you running from Xcode and hitting "Stop" or are you qutting the app from within the app (for example, qutting from the dock or the menubar)?

Window keeps reverting to an earlier size
 
 
Q