this is my code:
If you want to handle your UI using weight then you should set width or height to 0. Otherwise, it will not work.
It will look like: