---restore content starts---
Steps to customize the cell (the height of each cell is different, and the contents of each cell are different)
1. Create a new subclass that inherits from UITableViewCell
2. Initialization of child controls in Initwithstyle: Method
+ (Instancetype) Cellwithtableview: (uitableview*) tableview{ static NSString *identifer = @ "status"; Statuscell *cell = [TableView dequeuereusablecellwithidentifier:identifer]; if (!cell) { cell = [[Statuscell alloc] Initwithstyle:uitableviewcellstylesubtitle reuseidentifier:identifer]; } return cell;}
1 /*2 cell initialization Method A cell is called only once3 It is common to add all the child controls that may be displayed, as well as the one-time settings for child controls4 */5-(ID) Initwithstyle: (Uitableviewcellstyle) style Reuseidentifier: (NSString *) Reuseidentifier6 {7Self =[Super Initwithstyle:style reuseidentifier:reuseidentifier];8 if(self) {9 Ten } One returnSelf ; A}
Add all child controls that are likely to be displayed to Contentview
By the way, set some properties of the child controls (one-time settings: font, text color, background)
----------------------------------------------------------------
Define the information contained within a statusframe model
1. Frame data for all child controls inside a cell
2. Storing a cell's height
3. Storage of a data model status
Steps to customize a cell