Thanks @Victor. The button are above one another. That’s the issue, the button move to the right…
I don’t understand what you mean about the visibility. You don’t suggest to do what I do?
To be honest, keeping proper layout when you have components with “sometimes visible” properties (showing and hiding), and if you want these components to “replace” each other, is quite difficult.
For example, in the almost empty screen this is how your button example worked for me:
The problem here is that in the other screen this layout most probably will not work. So it is always trial and error before you find the suitable layout.
So I don’t know a universal solution, sorry.
As for me, I have decided to avoid UX designs which needs to change the color of the same element