This seems like such a simple task, yet I am unable to find a good answer.
I have a view where I will have up to 4 buttons 1 will take up the entire width, and the other 3 will layoud on a seperate row, and will show any number of the 3 depending on state.
The one that shows up and will be fully across the view is no problem, the 3 below it however are a problem. Not that I can’t make them appear, but that not all 3 of them may always will be shown, so, this row may show as few as 1 button, or as many as 3 buttons, and depending on the number of buttons visible each button should take up the width of the view divided by the number of buttons.
Now I know I can explcitely calculate out the size of each button for each of the cases before adding and this would work, but this seems abjectly silly, is there no way to tell iOS to simply size them dynamically based on how many there are? IE here’s a row of buttons divide them up appropriately and lay them out beside each other.?
I want to believe somewhere this sort of thing exists, but so far I’m just not seeing it. Anyone know an answer beside code it explicitely? I would like to think IB would support resizing parts of a view based on show or hidden elements etc, but it doesn’t seem so.
Not on iOS SDK, but this is the kind of controller people will eventually code up. Try doing a your own view controller, or look for one on github or cocoacontrols, I’m sure you’ll find something like this.