ios - Allow last UITableViewCell to scroll till first row -


generally in uitableview last uitableviewcell not allowed scroll up, want allow last uitableviewcell till reaches first row.

one way know adding empty footer uitableview, can not figure out how space need give footer allowing last row scroll.

edit : adding empty footerview uitableview did trick me

i not sure think may depending on contentinset , if last cell height not known

  -(void)scrollviewdidenddecelerating:(uiscrollview *)scrollview   {      cgrect temrect=cgrectmake(0, scrollview.contentsize.height-3, scrollview.frame.size.width, 3);     // here expecting height of last row atleast 3 ,       (uiview *temv in scrollview.subviews)       {          if (cgrectintersectsrect(temrect, temv.frame)) // check ing intersection           {              cgfloat bottominset = scrollview.frame.size.height - temv.frame.size.height;               scrollview.contentinset = uiedgeinsetsmake(0, 0 , bottominset, 0);              break;          }     }  } 

note: not apply if table view frame height greater table view contentsize. applies if temrect parameters intersect cell

hope helps


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -