When scrolling is required, a scrollable view that includes UI virtualization, such as ListView or CollectionView, should be used. While scrolling can be provided by wrapping a bindable layout in a ScrollView, this is not recommended as bindable layouts lack UI virtualization. For more information about the Xamarin.Forms layout cycle, see Creating a Custom Layout.īindable layouts should only be used when the collection of items to be displayed is small, and scrolling and selection isn't required. The Layout-derived class will then update its child views when the underlying collection changes. When the BindableLayout.ItemsSource property is set to a collection of items and attached to a Layout-derived class, each item in the collection is added to the Layout.Children collection for display by the layout.
The Layout class exposes a Children collection, to which the child elements of a layout are added. The EmptyViewTemplate property takes precedence when both the EmptyView and EmptyViewTemplate properties are set.Īll of these properties can be attached to the AbsoluteLayout, FlexLayout, Grid, RelativeLayout, and StackLayout classes, which all derive from the Layout class.