Customizing a cell's appearance

We are now going to design our cells that will appear for every model found in the TableSource class. Add a new .cs file for our custom UITableViewCell.

Note

We are not going to use a .xib and simply build the user interface directly in code using a single .cs file.

Now for the implementation:

public class GalleryCell: UITableViewCell { private UIImageView _imageView; private UILabel _titleLabel; private UILabel _dateLabel; public GalleryCell (string cellId) : base (UITableViewCellStyle.Default, cellId) { SelectionStyle = UITableViewCellSelectionStyle.Gray; _imageView = new UIImageView() { TranslatesAutoresizingMaskIntoConstraints = false, }; _titleLabel = new UILabel () { TranslatesAutoresizingMaskIntoConstraints = ...

Get Xamarin Blueprints 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.