I am developing an application for iOS and I am using Storyboard with AutoLayout ON. One of my view controllers has a set of 4 buttons, and in some cases I would like the first one to disappear.
If I use the setHidden:TRUE method, the UIButton becomes invisible, but it still clearly takes up space in the view, and the result is a βholeβ that I could not fill so that the remaining UIButton floated in the top direction of the main view.
In Android, I would just use View.GONE instead of View.INVISIBLE , but on iOS I am stuck with this behavior and I donβt want to believe that the only solution is to manually (yes, I mean programmatically) move the remaining elements to the beginning.
I thought I could do this by installing some kind of Constraint to make everything as automatic as on Android, but I had no luck.
Before disabling auto-shutdown, can someone point me in the right direction?
I use IB, but I also like the program material.
UPDATE:
Setting the height of the component to 0 also does not help.
I tried something like this:
UIButton *b; CGRect frameRect = b.frame; frameRect.size.height = 0; b.frame = frameRect;
visibility ios iphone autolayout interface-builder
elbuild Jul 25 '13 at 21:41 2013-07-25 21:41
source share