Created
February 14, 2018 16:37
-
-
Save jonathanpeppers/7101378493e2b264409e627a7a299ce5 to your computer and use it in GitHub Desktop.
A grid with 4 columns of 100 images, falls over in Xamarin.Forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var grid = new Grid(); | |
grid.ColumnDefinitions.Add(new ColumnDefinition()); | |
grid.ColumnDefinitions.Add(new ColumnDefinition()); | |
grid.ColumnDefinitions.Add(new ColumnDefinition()); | |
grid.ColumnDefinitions.Add(new ColumnDefinition()); | |
for (int i = 0; i < 100; i++) | |
{ | |
grid.RowDefinitions.Add(new RowDefinition()); | |
for (int j = 0; j < 4; j++) | |
{ | |
var image = new Image | |
{ | |
Source = ImageSource.FromFile("some_resource"); | |
}; | |
Grid.SetRow(image, i); | |
Grid.SetColumn(image, j); | |
grid.Children.Add(image); | |
} | |
} | |
yourScrollView.Content = grid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment