다음을 통해 공유


NSLayoutConstraint.ActivateConstraints(NSLayoutConstraint[]) 메서드

정의

전달된 모든 제약 조건을 활성화합니다.

[Foundation.Export("activateConstraints:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 8, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static void ActivateConstraints (UIKit.NSLayoutConstraint[] constraints);
static member ActivateConstraints : UIKit.NSLayoutConstraint[] -> unit

매개 변수

constraints
NSLayoutConstraint[]

활성화할 제약 조건입니다.

특성

설명

이 메서드는 속성을 true로 설정하는 Active 것과 동일한 효과가 있습니다.

var blueView = new ContentView(UIColor.Blue);
view.AddSubview(blueView);

blueView.TranslatesAutoresizingMaskIntoConstraints = false;
var blueConstraints = new []
{ 
    blueView.LeadingAnchor.ConstraintEqualTo(greenView.LeadingAnchor),
    blueView.TrailingAnchor.ConstraintEqualTo(greenView.TrailingAnchor),
    blueView.TopAnchor.ConstraintEqualTo(greenView.BottomAnchor, 10.0f),
    blueView.HeightAnchor.ConstraintEqualTo(greenView.HeightAnchor),
    blueView.WidthAnchor.ConstraintEqualTo(greenView.WidthAnchor)
};

NSLayoutConstraint.ActivateConstraints(blueConstraints);

적용 대상