ios - Why "Y" value in bounds property for UITableView and UIScrollView is initially "-64"? -


when print tableview.bounds in

viewdidload , viewwillappear, (0.0, 0.0, 375.0, 667.0)

but in viewdidappear , scrollviewdidscroll methods, (0.0, -64.0, 375.0, 667.0)

why "y" value in negative. , keep on reducing negative value when scroll down. per assumptions, should increase in positive axis when scrolled down , when scroll up, view goes origin goes up, should reduce in negative axis while scrolling up. means, happening in opposite direction assumptions. why that?

could explain ?

64 height of navigation bar , status bar. in viewdidload , viewwillappear, bounds not done laying out. should correct bounds in viewdidlayoutsubviews.

as why y axis goes negative when scrolling down, that's because you're printing bounds. if want value you're expecting mentioned in question, need use tableview.contentoffset.y. think question regarding difference between frame , bounds helpful too.


Comments