I have googled but not find out answer. So I need to ask. I have one home screen. When User is logged in it will display one view as like bellow Now When User logged out and visiting home page he will see above layout but without center boxed layout. If I set That layout hidden it is now displaying as follows.
I want to move third layout to little bit above to remove white space..
I added constraints using storyboard. Now need to remove constraints from programming and add one constraints that will set layout to bellow first layout..
To remove a single constraint just select it and hit delete. To remove constraints for a single view you select the view and hit the triangle button in the bottom right hand corner... And hit "Clear Constraints" under the "Selected Views" part.
To delete a check constraint In Object Explorer, expand the table with the check constraint. Expand Constraints. Right-click the constraint and click Delete. In the Delete Object dialog box, click OK.
When developing for iOS 8.0 or later, set the constraint's isActive property to false instead of calling the removeConstraint(_:) method directly. The isActive property automatically adds and removes the constraint from the correct view.
As @Henit mentioned, you can set IBOutlet for constraints as well.
For example,
@property(weak, nonatomic) IBOutlet NSLayoutConstraint *viewHeight;
so now, you can remove this constraint like this:
[myView removeConstraint: viewHeight];
Or else if you want to remove all / multiple constraints related to your view then,
[myView removeConstraints: constraintsArrayHere]; // custom array of constraints references
[myView removeConstraints: [myView constraints]]; //all constraints
Then later you can add your new constraints in the same manner using addConstraint
or addConstraints
method.
For more details go through Apple Documentation here.
Hope this helps.
removeConstraints will be deprecated in future.
You can use the following as alternative
viewHeight.active = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With