Hiding button leaves whitespace instead of dropping down top button in ios

StackOverflow https://stackoverflow.com/questions/23257327

  •  08-07-2023
  •  | 
  •  

Вопрос

I am hiding the second button below, but I want the top button to drop down. Is there a way to do that where it has a relative layout.

enter image description here

Это было полезно?

Решение

Yes you can do this. One of my project I had to do this. If you are using autolayout then you can not manually change your buttons frames. You can either have to disable autolayout, or modify the constraints programmatically. I followed the first one.

In your case, if you want the first button to take the position of the second one (which you are hiding) then take the frame of the second button and assign it to the first button.

Hope this helps. :)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top