make checkbox expandable
This commit is contained in:
parent
9f8681f12f
commit
3cb075499e
@ -228,7 +228,9 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
|||||||
NSDictionary *constraints = [NSLayoutConstraint constraintPinView:checkedSquare heightConstraint:YES heightConstant:size widthConstraint:YES widthConstant:size];
|
NSDictionary *constraints = [NSLayoutConstraint constraintPinView:checkedSquare heightConstraint:YES heightConstant:size widthConstraint:YES widthConstant:size];
|
||||||
self.checkboxWidth = constraints[ConstraintWidth];
|
self.checkboxWidth = constraints[ConstraintWidth];
|
||||||
self.checkboxHeight = constraints[ConstraintHeight];
|
self.checkboxHeight = constraints[ConstraintHeight];
|
||||||
[NSLayoutConstraint constraintPinSubview:checkedSquare pinTop:YES pinBottom:YES pinLeft:YES pinRight:NO];
|
[NSLayoutConstraint constraintPinSubview:checkedSquare pinTop:NO pinBottom:NO pinLeft:YES pinRight:NO];
|
||||||
|
[checkedSquare.topAnchor constraintGreaterThanOrEqualToAnchor:containterView.topAnchor].active = YES;
|
||||||
|
[containterView.bottomAnchor constraintGreaterThanOrEqualToAnchor:checkedSquare.bottomAnchor].active = YES;
|
||||||
|
|
||||||
self.checkboxRightPinConstraint = [checkedSquare.trailingAnchor constraintEqualToAnchor:containterView.trailingAnchor];
|
self.checkboxRightPinConstraint = [checkedSquare.trailingAnchor constraintEqualToAnchor:containterView.trailingAnchor];
|
||||||
|
|
||||||
@ -256,6 +258,8 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
|||||||
[containterView addSubview:descriptionLabel];
|
[containterView addSubview:descriptionLabel];
|
||||||
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinCenterX:NO pinCenterY:YES];
|
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinCenterX:NO pinCenterY:YES];
|
||||||
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinTop:NO pinBottom:NO pinLeft:NO pinRight:YES];
|
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinTop:NO pinBottom:NO pinLeft:NO pinRight:YES];
|
||||||
|
[descriptionLabel.topAnchor constraintGreaterThanOrEqualToAnchor:containterView.topAnchor].active = YES;
|
||||||
|
[containterView.bottomAnchor constraintGreaterThanOrEqualToAnchor:descriptionLabel.bottomAnchor].active = YES;
|
||||||
|
|
||||||
self.descriptionLabelLeadingConstraint = [NSLayoutConstraint constraintWithItem:descriptionLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.checkedSquare attribute:NSLayoutAttributeTrailing multiplier:1 constant:11];
|
self.descriptionLabelLeadingConstraint = [NSLayoutConstraint constraintWithItem:descriptionLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.checkedSquare attribute:NSLayoutAttributeTrailing multiplier:1 constant:11];
|
||||||
self.descriptionLabelLeadingConstraint.active = YES;
|
self.descriptionLabelLeadingConstraint.active = YES;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user