Skip to end of metadata
Go to start of metadata

UICellLabel is a special label control designed for use in a UITableView. Unlike the native iOS label control, UICellLabel maintains its background color and styles when the table's cell is selected. This lightweight yet handy control lets you easily create beautiful indicators by simply dropping the control in your cell template view, eliminating tedious code and class subclassing commonly required to achieve this task.

 

On this page:

Adding UICellLabel to Cell Template

The easiest way to add UICellLabel control to a table cell is through the Xcode Interface Designer. To edit a cell template in Xcode, you can double click an XIB file from Xamarin Studio. The remaining steps are similar to adding a standard control to the cell template. For more details, see Create Custom Cell Template for iOS UITableView.

The following figure shows the cell label control in Xcode Interface Designer.

By default, Xcode doesn't show custom controls in the Toolbox. To add a custom control such as UICellLabel, you can start by dragging a UIView from the toolbox to the designer surface and arrange it the way you desire. Finally, click the Identity Inspector and specify the custom class to UICellLabel show as shown in the figure above.

Samples

To see UICellLabel in action, please refer to the View Projection samples at http://git.intersoftpt.com/projects/CROS-SUPP/repos/view-projection-samples/browse. The label control is used in the list to indicate the status of the order.