0

I am new to IOS and I am adding constrain to my added view with using constraintsWithVisualFormat. I already use constraintsWithVisualFormat to have vertical spacing by these following code:-

    self.underlineConstraints = [NSLayoutConstraint 
    constraintsWithVisualFormat:@"V:[view]-80-[underlineView(5)]" 
    options:NSLayoutFormatAlignAllLeading | NSLayoutFormatAlignAllTrailing 
    metrics:nil views:views];

Here 5 is height of underlineView and 80 is space between two views but I want to add constrain of width of underlineView 150.

halfer
  • 19,824
  • 17
  • 99
  • 186
shree Ram
  • 5
  • 1
  • 8

1 Answers1

0

To add width constraints:

[self.view addConstraints: [NSLayoutConstraint 
                            constraintsWithVisualFormat:@"H:[underlineView(150)]"
                            options: kNilOptions
                            metrics:nil views:views]];
Francesco Deliro
  • 3,899
  • 2
  • 19
  • 24