Customizing the row template

Xamarin.Forms has four built-in cell types:

  • EntryCell – a cell with a Label and a single-line text Entry field
  • SwitchCell – a cell with a Label and an on/off switch
  • TextCell – a cell with primary and secondary text
  • ImageCell – a cell that also includes an image

But this is not enough for every case that you need, or sometimes will not provide you with a nice result. Xamarin.Forms has another type, ViewCell, that you can use to customize the layout as desired.

You are welcome to extend any of these types to introduce custom functionality.

How to do it…

  1. In Visual Studio, go to the top menu and select File | New | Project. Choose the Blank App (Xamarin.Forms Portable) template, name it XamFormsCustomizingRows, and click OK.

Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.