Strange behaviour of vertical uiscrollbar at uitableview
-
12-12-2019 - |
Question
I am using the code below to set the content offset of the uitableview after the retrieval of more data from a server.
[tablefollow setContentOffset:CGPointMake(0, tablefollow.contentSize.height- self.tablefollow.bounds.size.height-5+ (numLines*(25/numLines))) animated:NO];
For some reason when i scroll down fast with my finger i notice that the vertical scroll bar reaches the end and disappears but then reappears a few rows up just for a second and then disappears again! This is happening when i am scrolling with my finger fast to the bottom of the uitableview. This does not occur when i slowly scroll to the bottom of the uitableview. Anyone got this issue before?
Any help appreciated.
La solution
The issue was that the code i mentioned was called even when the user was scrolling the uitableview. It has nothing to do with the speed of the scroll. I just added a value in the scrollviewdidbegindragging and set it to TRUE and then when the scrollviewdidenddragging occurs i set it to FALSE. I have put this code in to my function
If (!scrollingvalue)
{
//execute code
}
When the value is FALSE (which means that the uitableview is not dragged by the user) then the code is executed else it is not executed. Hope it helps someone.