-
StackOverflow 文档
-
Xamarin.iOS 教程
-
Xamarin.iOS 中的自动布局
-
使用 iOS 9 布局锚点添加约束
Version >= 9.0
// Since the anchor system simply returns constraints, you still need to add them somewhere.
View.AddConstraints(
new[] {
someLabel.TopAnchor.ConstraintEqualTo(TopLayoutGuide.GetBottomAnchor()),
anotherLabel.TopAnchor.ConstraintEqualTo(someLabel.BottomAnchor, 6),
oneMoreLabel.TopAnchor.ConstraintEqualTo(anotherLabel.BottomAnchor, 6),
oneMoreLabel.BottomAnchor.ConstraintGreaterThanOrEqualTo(BottomLayoutGuide.GetTopAnchor(), -10),
}
);