In this recipe, we will create a table view that uses our own custom subclass of UITableViewCell
to display data.
Create a new project in Xamarin Studio in the same manner in which the project in the earlier recipe was created. Name it CustomRowsApp
.
Implement the class with the following code:
[Register("CustomCell")] public partial class CustomCell : UITableViewCell { public const string CELLID = "CustomCell"; public CustomCell (IntPtr handle) : base(handle) {} [Outlet("lblTitle")] public UILabel LabelTitle { get; private set; } [Outlet("imgView")] public UIImageView ImgView { get; private set; } }
Add a new Empty iPhone Interface Definition to the project and name it
CustomCell
. Don't worry about the name conflicting with the class we created earlier, as this is an XIB file. Open the file in Interface Builder.Add
UITableViewCell
on the canvas. The following...