HorizontalOptionsproperties of a layout unless required. The default values of
LayoutOptions.FillAndExpandallow for the best layout optimization. Changing these properties has a cost and consumes memory, even when setting them to the default values.
Gridto help reduce nesting.
TranslationYproperties as this avoids the need for layout.
StackLayoutto host a single child. Instead, use the
StackLayouts when a
StackLayouts to simulate a
ScrollViewto simulate a
LayoutOptions.Expands. This property ensures that the specified child will occupy the largest space that the
StackLayoutcan give to it, and it is wasteful to perform these calculations more than once.
AbsoluteLayout.AutoSizeproperty whenever possible.
RelativeLayoutwhenever possible. It will result in the CPU having to perform significantly more work.
Gridto achieve layering.
ScrollViewas it's a very bad practice. Use the
TableViewwhere you can use a
TableViews are usually recommended for a setting like UI.
DataTemplateselectors to facilitate heterogeneous views within a single
ListView. Don’t override
OnBindingContextChangedto update and achieve the same effect.
IEnumerable<T>as a data source to
ListViews. Instead, try to use
IEnumerable<T>collections don't support random access.
ListViews is explicitly unsupported and will break your application.
ListViewhas rows of differing sizes.
Fillis the cheapest to compute).
Labels when one will do (using spans with
Labelwrapping if possible (
Label.VerticalTextAlignmentproperty unless required.
Labelinstances more frequently than required, as the change of size of the label can result in the entire screen layout being re-calculated.
Labels. If the updates are to multiple
Labels, update as a batch if possible.