1

I'm developing an iphone app in which I have a UITableViewController in which the tableView contains two sections.

The first section contains a single row of height 0.
The second section contains 100 rows each with a height of 44.0f.

I am using section 0 as the title view for the tableView.
While the user scrolls up, section-0 header goes up and section-1 header becomes the title view for the tableView.
Now, instead of the Section-0 header going up, i want it to shrink while the user scrolls up.

staticVoidMan
  • 19,275
  • 6
  • 69
  • 98
Seeker
  • 644
  • 1
  • 8
  • 18
  • so basically... you want section 0 header to be always visible, correct? – staticVoidMan Nov 23 '13 at 08:56
  • @staticVoidMan:No, while the tableview scroolUp, section 0 header replaced by section 1 header. In that time the section 0 header goes up you know. But in my case instead of goes up, shrink the section 0 header while section 0 replace by section 1 header – Seeker Nov 23 '13 at 09:11
  • ?? what EXACTLY u want?? what it means - shrink the section 0 header while section 0 replace by section 1 header??? – Nayan Nov 23 '13 at 09:14
  • @user2922837: so... you want section-0 header to shrink while going up before being replaced by section-1's header... ?? – staticVoidMan Nov 23 '13 at 09:16
  • @NSS:Like instagram app – Seeker Nov 23 '13 at 09:25

1 Answers1

0

Use the scrollViewDidScroll: or scrollViewWillBeginDragging: delegate method to track the contentOffset of the tableView.
Then, logically, set the height of the section header accordingly.
i.e. To give it a shrink effect, you can slowly reduce the height of the section header until it gets replaced by the next section header.


Or see this: How to resize a tableHeaderView of a UITableView?

Community
  • 1
  • 1
staticVoidMan
  • 19,275
  • 6
  • 69
  • 98