שתף באמצעות


Xamarin.Forms Cells

Xamarin.Forms cells can be added to ListViews and TableViews.

A cell is a specialized element used for items in a table and describes how each item in a list should be rendered. The Cell class derives from Element, from which VisualElement also derives. A cell is not itself a visual element; it is instead a template for creating a visual element.

Cell is used exclusively with ListView and TableView controls. To learn how to use and customize cells, refer to the ListView and TableView documentation.

Cells

Xamarin.Forms supports the following cell types:

Type Description Appearance
TextCell A TextCell displays one or two text strings. Set the Text property and, optionally, the Detail property to these text strings.

API Documentation / Guide
TextCell Example
C# code for this page / XAML page
ImageCell The ImageCell displays the same information as TextCell but includes a bitmap that you set with the Source property.

API Documentation / Guide
ImageCell Example
C# code for this page / XAML page
SwitchCell The SwitchCell contains text set with the Text property and an on/off switch initially set with the Boolean On property. Handle the OnChanged event to be notified when the On property changes.

API Documentation / Guide
SwitchCell Example
C# code for this page / XAML page
EntryCell The EntryCell defines a Label property that identifies the cell and a single line of editable text in the Text property. Handle the Completed event to be notified when the user has completed the text entry.

API Documentation / Guide
EntryCell Example
C# code for this page / XAML page