As we all know, when the TableView style is plain, the header view of the section is set to have a card under navbar effect.
But when the properties of Tablview in the actual development are changed back to this
I thought I was going to get stuck with this thing, and then I looked at the hierarchical relationship of the view. The location of the section has changed, actually.
As long as it's here, okay?
In-(void) Scrollviewdidscroll: (Uiscrollview *) ScrollView;
//This method is triggered when the scrollview is sliding, because UITableView inherits from Uiscrollview and therefore can also be called hereCGFloat Header = -;//This header is actually Section1 's header to the top of the distance if(scrollview.contentoffset.y<=header&&scrollview.contentoffset.y>=0) { //When the distance of the view slide is less than the headerScrollview.contentinset = Uiedgeinsetsmake ( -,0,0,0); }Else if(scrollview.contentoffset.y>header) { //when the view sliding distance is greater than the header, here you can set the location of the header of the Section1, when set to take into account the navigation bar transparency on the impact of scrolling viewScrollview.contentinset = Uiedgeinsetsmake (header*0.5+103,0,0,0); }
The exact numeric position is calculated by itself.
Headerview location of section in IOS TableView