I want to divide a grid in three equal (absolute) horizontal parts.
For instance: three parts.
My idea would be that of creating Column definitions that have an absolute width of one third of Application.Context.Resources.DisplayMetrics.WidthPixels.
So,
int DeviceWidth= Application.Context.Resources.DisplayMetrics.WidthPixels;
new ColumnDefinition {Width = new GridLength(DeviceWidth/3, GridUnitType.Absolute) }, //0
new ColumnDefinition {Width = new GridLength(DeviceWidth/3, GridUnitType.Absolute) }, //1
new ColumnDefinition {Width = new GridLength(DeviceWidth/3, GridUnitType.Absolute) }, //2
However, with a Google Nexus 4.4.2, this makes the cells HUGE.
The only way to have this working is using one SIXTH
new ColumnDefinition {Width = new GridLength(DeviceWidth/6, GridUnitType.Absolute) }, //0
new ColumnDefinition {Width = new GridLength(DeviceWidth/6, GridUnitType.Absolute) }, //1
new ColumnDefinition {Width = new GridLength(DeviceWidth/6, GridUnitType.Absolute) }, //2
I guess this means that the double density comes into play?
How to retrieve the real widths and hieghts that the device exposes to the views?