-1

When I am scrolling vertically row is going inside of headerview of table, how will change to stop going of row inside of header of UITableView. I have some important view which should show always top of UITableView and if user scroll it should hide as row hides.

Going row in top header should also go on top.

I mean it should show attaching headerview with first row.

Code cracker
  • 3,105
  • 6
  • 37
  • 67
Ajay_Kumar
  • 1,381
  • 10
  • 34
  • 62
  • header should also go up as user scroll? – Durgaprasad Jul 09 '13 at 12:53
  • Yes..exactly..same as row is going up.. – Ajay_Kumar Jul 09 '13 at 12:57
  • 1
    rewrite your question properly. cant understand exactly what you want – Durgaprasad Jul 09 '13 at 12:59
  • then add 1 extra cell on top. if you put header view it wont go as row. – Durgaprasad Jul 09 '13 at 13:00
  • Do you mean section headers or the table header? – Florian Jul 09 '13 at 13:00
  • check this [http://stackoverflow.com/questions/1074006/is-it-possible-to-disable-floating-headers-in-uitableview-with-uitableviewstylep](http://stackoverflow.com/questions/1074006/is-it-possible-to-disable-floating-headers-in-uitableview-with-uitableviewstylep) – Bhavin_m Jul 09 '13 at 13:01
  • This question is already discussed here: [Change Default Scrolling Behavior of UITableView Section Header](http://stackoverflow.com/questions/664781/change-default-scrolling-behavior-of-uitableview-section-header) – DD_ Jul 09 '13 at 13:11

1 Answers1

0

keep numberOfCell

array.count+1

In cellForRow method

if(indexPath.row == 0)
{
    //create your cell as header and return
}
else
{
     //return normal cells
}
Durgaprasad
  • 1,910
  • 2
  • 25
  • 44
  • hmmm..ok.. that I was thinking to do.. but I thought if there would be any function which disabled the scrolling of rows inside of section...accepting this answer.. – Ajay_Kumar Jul 09 '13 at 13:09
  • to make more clean code you can add two sections. in section 0 add one cell and in section 1 add others. njoy coding – Durgaprasad Jul 09 '13 at 13:13