how can i make headerView scroll (not stay on the top of the tableview ) accompanying with UItableViewCell when i was scrolling tableview

You can disable scrolling sectionHeader by changing the table property to -

UITableViewStyleGrouped

You have to set it on the initialisation of UITableView.

  • Set from StoryBoard

OR

UITableView* table = [[UITableView alloc]initWithFrame:myFrame style:UITableViewStyleGrouped]; 

subclass the UITableView and override this method

- (BOOL)allowsHeaderViewsToFloat{
    return NO;
}

same for footer

- (BOOL)allowsFooterViewToFloat{
    return NO;
}

But I think that this is a private API ... You will not be able to submit it to the AppStore

If you will upload it to the AppStore; Then you have two other options

  1. Adding a normal cell instead of the section header
  2. If you have only one section, then you can simply use table header instead of section header

Just change style of table from "Plain" to "Grouped".