The problem is that you're using auto layout and you've moved your interface around by setting the frame
of your labels, images, and buttons. But frame
and auto layout are opposites. Since you are using auto layout, you should have changed the constraints of your labels, images, and buttons.
So what's happening now is that you're setting the text of a label and this in turn is causing layout to happen. Layout, when auto layout is involved, means obeying the constraints. You didn't change the constraints, so, just as you say, this means that everything goes back to its original position - because that is what your constraints say to do.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…