Skip to content

Instantly share code, notes, and snippets.

@pita5
Created November 9, 2012 11:56
Show Gist options
  • Save pita5/4045354 to your computer and use it in GitHub Desktop.
Save pita5/4045354 to your computer and use it in GitHub Desktop.
self.label = [[UILabel alloc] init];
self.segmentedControl = [[UISegmentedControl alloc] init];
[self.contentView addSubview:_segmentedControl];
[self.contentView addSubview:_label];
NSDictionary* viewsDictionary = @{@"segmentedControl" : _segmentedControl, @"label" : _label};
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[label(>=100)]-[segmentedControl(>=100)]-|"
options:NSLayoutFormatAlignAllTop
metrics:nil
views:viewsDictionary]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment