0

So i have sticky header at the top of view. Then i have table view. It starts from y:135

I need to do something to allow first section header to sroll up with its content. How i can make it?

I decide to make table view padding top if it possible, and than start table view from x:0 y:0

OR

To unfix section header and allow to scroll with content, or maybe there is another way to do that? Here is my screens:

enter image description here

enter image description here

OR Maybe the correct way will be to FAKE fist section with custom row height? and make it unvisible, and it will be my padding?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
WhoIsDT
  • 695
  • 2
  • 9
  • 27

1 Answers1

1

allow first section header to sroll up with its content

It's related to UITableViewStyle. When the UITableViewStyle property of the table is set to UITableViewStylePlain. If you have it set to UITableViewStyleGrouped, the headers will scroll up with the cells. Based on this question.

to FAKE fist section with custom row height?

I am not sure that it's a good solution.

biloshkurskyi.ss
  • 1,358
  • 3
  • 15
  • 34
  • Thanks allot! so i decided to make UITableViewStyleGrouped, but now i have some extra paddings in section headers. In my screens it was 36 height, but now i guess it much more than 36. Can i manage it? – WhoIsDT Dec 16 '17 at 15:41
  • @WhoIsDT please look to [this question](https://stackoverflow.com/questions/17699831/how-to-change-height-of-grouped-uitableview-header) and also check `heightForFooterInSection` maybe you use it somewhere. – biloshkurskyi.ss Dec 16 '17 at 15:45
  • 1
    tableView.sectionFooterHeight = 0 - thats completely helped! Thank you very much! – WhoIsDT Dec 16 '17 at 15:54