I thought there might be a way to easily hide and show a button in a row using auto layout so that views could be automatically arranged neatly depending on which are visible.

For example, say I have two buttons that I always want centered in a frame:

// pseudo visual format code:
|-----[star][download]-----|

When I press download I want now to see three buttons: (pause is the download button relabelled; cancel is a previously hidden button)

|--[star][cancel][pause ]--|

I thought I could perhaps have all three buttons always present but perhaps override the width to make the view gracefully animate between states? I thought there might be a more semantic way to achieve the adding and removing of views from the auto layout structure. Any thoughts?

Edit
Report