How to set a section of the same height including the first column (small tricks, although easy but easy to ignore)
* First step, set tail to 0,table.sectionfooterheight = 0 in Viewdidload, (proxy method)-(CGFloat) TableView: (UITableView *) TableView Heightforfooterinsection: (Nsinteger) section{
return 0;
Although you can also set the tail height, there is no effect after setting
In the second step, call TableView's Proxy Method-(CGFloat) TableView: (UITableView *) TableView heightforheaderinsection: (Nsinteger) section{
return 30;
} Set the head height to 30;
Run results
Custom packet header reuse (similar to cell)
If you customize the group header
For memory optimization, you can use a cell-like reuse mechanism to implement
#pragma mark-Custom group header
-(UIView *) TableView: (UITableView *) TableView viewforheaderinsection: (Nsinteger) section{
Static NSString * Identy = @ "Headfoot";
Uitableviewheaderfooterview * HF = [TableView dequeuereusableheaderfooterviewwithidentifier:identy];
if (!HF) {
NSLog (@ "%li", section);
HF = [[Uitableviewheaderfooterview alloc]initwithreuseidentifier:identy];
UIView * view = [[UIView alloc]initwithframe:cgrectmake (0, 0, Self.view.frame.size.width, 44)];
View.backgroundcolor = [Uicolor Redcolor];
[HF Addsubview:view]; (If you add this comment: view is not added)
}
Hf.contentView.backgroundColor = [Uicolor purplecolor]; (Remove this line comment: The HF can be set.) Contentview background color), if this line and the previous line are not annotated, the red
return HF;
}
Affine transformations
-(void) clickaction{
Affine transformations
[UIView animatewithduration:0.5 animations:^{
Execute once
Self.rectView.transform = cgaffinetransformmaketranslation (100, 100);
Continue on the basis of Self.rectView.transform's current
Self.rectView.transform = Cgaffinetransformtranslate (self.rectView.transform, 100, 100);
// }];
//
Affine proportions
[UIView animatewithduration:0.5 animations:^{
Execute once
Self.rectView.transform = Cgaffinetransformmakescale (5, 0.5);
Continue on the basis of Self.rectView.transform's current
Self.rectView.transform = Cgaffinetransformscale (Self.rectView.transform, 2, 2);
Self.rectView.transform = cgaffinetransformmaketranslation (100, 100);
//
// }];
Affine rotation
[UIView animatewithduration:0.5 animations:^{
100 degrees
CGFloat degree100 = 100/180.0*M_PI;
CGFloat degree45 = m_pi_4;
Execute once
Self.rectView.transform = Cgaffinetransformmakerotation (m_pi_4);
Continue on the basis of Self.rectView.transform's current
Self.rectView.transform = Cgaffinetransformrotate (Self.rectView.transform, degree100);
}];
}
iOS Uitableview,uitableviewheaderfooterview packet Head reuse mechanism, simple affine transform Cgaffinetransformios UITableView, Uitableviewheaderfooterview the reuse mechanism of packet head, simply affine transform Cgaffinetransformios UITableView, Uitableviewheaderfooterview the reuse mechanism of packet head, and simply affine transform Cgaffinetransform
iOS Uitableview,uitableviewheaderfooterview packet Head reuse mechanism, simple affine transform Cgaffinetransform