Considering performance - where is the sweet spot between grid and nested stacklayouts?
How many "levels of nesting" StackLayout makes it more efficient to use Grid?
Is the example below (3 levels of StackLayout nesting) good practice, or should one use Grid instead?
<StackLayout>
<StackLayout>
<StackLayout>
<Label>...text...</Label>
</StackLayout>
<StackLayout>
<Label>...text...</Label>
</StackLayout>
</StackLayout>
<StackLayout>
<StackLayout>
<Label>...text...</Label>
</StackLayout>
<StackLayout>
<Label>...text...</Label>
</StackLayout>
</StackLayout>
</StackLayout>
You should use Grid.
There's a lot of common mistakes we make when using Xamarin.Forms
. Fortunately, I found this article and video that help me a lot.
One of the points on it is exactly an advice about your question:
don't attempt to reproduce the appearance of a specific layout by using combinations of other layouts
This is exemplified by Grid
x nested StackLayouts
.
I hope it helps you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With