Issue
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>
Solution
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.
Answered By - Diego Rafael Souza
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.