NSLayoutConstraint.ActivateConstraints(NSLayoutConstraint[]) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengaktifkan semua batasan yang dilewati.
[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
Parameter
- constraints
- NSLayoutConstraint[]
Batasan untuk mengaktifkan.
- Atribut
Keterangan
Metode ini memiliki efek yang sama dengan mengatur properti ke Activetrue
.
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);