What do I need to do to avoid the default spacing between two buttons? I have tried setting padding to 0, BorderWidth etc. I am using Grid like this:
in ctor:
InitializeComponent();
var grid = new Grid
{
RowSpacing = 0,
ColumnSpacing = 1,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Padding = 0,
RowDefinitions =
{
new RowDefinition { Height = new GridLength(100, GridUnitType.Auto) },
.... 9 more
},
ColumnDefinitions =
{
new ColumnDefinition{ Width = new GridLength(100, GridUnitType.Auto) },
.... 9 more }
};
const int numCols = 10;
const int numRows = 10;
for (int i = 0; i < numCols; i++)
for (int k = 0; k < numRows; k++)
{
var gridButton = new Button
{
Text = (i).ToString() + "," + (k).ToString(),
BorderWidth = 0,
BorderRadius = 0,
HorizontalOptions = LayoutOptions.FillAndExpand,
// Bounds = new Rectangle(50*i,50*k, 50, 50)
};
gridButton.Clicked += delegate
{
gridButton.Text = string.Format("{0}", count++);
};
grid.Children.Add( gridButton, i, k); // Left, Third element
}
this.Content = grid;
}