InterviewSolution
| 1. |
What Is Difference Between "auto" And "*" In Windows 10 Uwp Grid Layout Definitions? |
|
Answer» AUTO: Takes as much SPACE as needed by the contained control. And it will make the each row/column size so it can fit WHATEVER is contained in it. "Star(*)": MEANS stretch row/column size to fill the available space, and is a fraction, so if one row is * and the other row is 2* then the second row will be twice the size of the first row. So for example, you may have two rows, bottom row has a button and is Auto (only as high as the button) and the top row is "*" - stretches to the remaining space available. <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Button Content="Test" Grid.Row="1" /> </Grid> Auto: Takes as much space as needed by the contained control. And it will make the each row/column size so it can fit whatever is contained in it. "Star(*)": means stretch row/column size to fill the available space, and is a fraction, so if one row is * and the other row is 2* then the second row will be twice the size of the first row. So for example, you may have two rows, bottom row has a button and is Auto (only as high as the button) and the top row is "*" - stretches to the remaining space available. <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Button Content="Test" Grid.Row="1" /> </Grid> |
|