I am in the process of learning and playing around with Auto Layout using Constraints and Visual Format Language. I have a UITableViewCell that I am trying to give 4 columns and I was testing out the following:
cellConstraints.AddRange( NSLayoutConstraint.FromVisualFormat( "H:|-[col1(==55)]-[col2(==113)]-[col3(==48)]-[col4(==48)]-|", NSLayoutFormatOptions.AlignAllCenterY, cellViewConstraints ) );
I kept getting a constraint size error and I was confused as to why. The above totals up too 320 (The width of the screen) assuming the left and right leading and trailing margins are as apple states:
The default margins are 8 points on each side. You can modify these margins based on your app’s needs.
So I thought:
16-55-8-113-8-48-8-48-16 for the width parameters. Which as mentioned totals = 320.
So I did a quick WriteLine to figure out what the values were and:
Console.Write ("Leading Margin: " + this.ContentView.LayoutMargins.Left);
Leading Margin: 15
So if I Change my width value to:
15-55-8-115-8-48-8-48-15 assuming the Leading and Trailing Margins are 15 it works.
This has got me confused. As far as I am aware I am not attempting to change any property that might affect the Layout Margins. Why would it be 15?