Building a CarouselView using custom layouts
Xamarin.Forms
is a very young layout system, meaning that the number of layouts is quite limited. There are times when we will need to implement our own custom layouts to give us control over exactly where and how our views and controls appear on screen. The requirement will come from situations where you need to improve performance on screens that display a lot of views and controls, and sometimes the standard layouts are not good enough. We want to implement our custom layouts to carry out the absolute minimum amount of work required to produce the required layout.
Note
All layouts derive from the Xamarin.Forms.Layout
class, which provides the required mechanisms for adding and removing children internally as well as some key utilities for writing a layout.
Let's start by adding a new folder called Controls
in the FireStorable
project. Add a new file called CarouselLayout.cs
and implement the first part as follows:
public class...