Plus head and bottom
- (void) viewdidload{[Super Viewdidload]; [Self tableView]; //Set Row HeightSelf.tableView.rowHeight = -; //Divider LineSelf.tableView.separatorStyle =Uitableviewcellseparatorstylesingleline; /** 32-bit True Color ARGB 2^8 * 2^8 * 2^8 * 2^8 = 2^32 = 2^2 * 2^10 * 2^10 * 2^10 = 4G 2^64 = GG A = Alpha R G B 24 bit True Color RGB 2^8 * 2^8 * 2^8 = 2 ^ 24 = 2^4 * 2^10 = 16 * 1 million R = Red 1 bytes 8 bit 0~255 G = Gr Een B = blun # FF FF FF*/Self.tableView.separatorColor= [Uicolor colorwithwhite:0.0Alpha0.2]; //Headview, placed at the top of the TableView view, usually used to place the picture carouselUIView *head = [[UIView alloc] Initwithframe:cgrectmake (0,0, the, the)]; Head.backgroundcolor=[Uicolor Bluecolor]; Self.tableView.tableHeaderView=Head; //Footerview, usually do pull-up refreshUIView *foot = [[UIView alloc] Initwithframe:cgrectmake (0,0, the, -)]; Foot.backgroundcolor=[Uicolor Redcolor]; Self.tableView.tableFooterView=Foot;}
Optimizing cell multiplexing View
//0. Reusable identifier string//static variable to ensure that the system allocates only one memory space for the variable in memory//static variables, once created, will not be released and will only be released if the application is destroyed! StaticNSString *id =@"Cell"; //1. Take the cache pool to find reusable cellsUITableViewCell *cell =[TableView Dequeuereusablecellwithidentifier:id]; //2. If you do not find if(Cell = =Nil) {NSLog (@"Instantiating cells"); //Create a cell, and set the properties of the cell that have commonality//instantiate a new cellCell =[[UITableViewCell alloc] Initwithstyle:uitableviewcellstylesubtitle Reuseidentifier:id]; //RIGHT ARROWCell.accessorytype =Uitableviewcellaccessorydisclosureindicator; //background color, which affects the label background for unselected table rows//Cell.backgroundcolor = [Uicolor Redcolor]; //in actual development, the use of background views is more//background view, does not need to specify the size, the cell will automatically fill the display of the background view according to its own size//UIImage *bgimage = [UIImage imagenamed:@ "img_01"];//Cell.backgroundview = [[Uiimageview alloc] initwithimage:bgimage];//UIView *bgview = [[UIView alloc] init];//Bgview.backgroundcolor = [Uicolor yellowcolor];//Cell.backgroundview = Bgview; //no background color selected//the selected background view//UIImage *selectedbgimage = [UIImage imagenamed:@ "img_02"];//Cell.selectedbackgroundview = [[Uiimageview alloc] initwithimage:selectedbgimage];}
iOS Seventh day (display of 4:uitableview data optimizes repeat instances and Tablefooterview and Tableheaderview)