This is the code from my root view controller which is using Frank's EasyLayout (from here: https://gist.github.com/praeclarum/6225853) to constrain the layout. The top, middle and bottom view are supposed to be as wide as the parent view. However, they are only 50% of it.
I don't get the issue:
public override void ViewDidLoad ()
{
this.View.BackgroundColor = UIColor.Yellow;
var topView = new UIView {
BackgroundColor = UIColor.Red
};
var bottomView = new UIView {
BackgroundColor = UIColor.Blue
};
var middleView = new UIView {
BackgroundColor = UIColor.Green
};
this.View.AddSubviews (topView, middleView, bottomView);
this.View.ConstrainLayout (() =>
topView.Frame.Top == this.View.Bounds.Top &&
topView.Frame.Height == 50 &&
topView.Frame.Width == this.View.Bounds.Width &&
bottomView.Frame.Top == (this.View.Bounds.Bottom - 50) &&
bottomView.Frame.Height == 50 &&
bottomView.Frame.Width == this.View.Bounds.Width &&
middleView.Frame.Top == topView.Bounds.Bottom &&
middleView.Frame.Bottom == bottomView.Bounds.Top &&
middleView.Frame.Width == this.View.Bounds.Width
);
foreach(var c in this.View.Constraints)
{
Console.WriteLine (c);
}
}