Skip to content
Discussion options

You must be logged in to vote

HorizontalStackLayout and VerticalStackLayout are different in performance. from StackLayout ... WHY?

Because StackLayout has to handle the Orientation property, and the other two do not.

In MAUI.Controls, the StackLayout is built from the Horizontal- and VerticalStackLayout classes - it looks at the value of the Orientation property and switches between the other two classes internally. Orientation is a bindable property, which means the StackLayout has to be prepared for it change at any time, and update the internal layout accordingly. And this has a slight performance impact.

So if you know that your layout orientation will never change, it's very slightly more performant to use a V…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@J-Swift
Comment options

@hartez
Comment options

@pierre01
Comment options

Answer selected by pierre01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
Converted from issue

This discussion was converted from issue #6766 on May 03, 2022 14:51.