UITableView scroll speed after frame size change

I have a UITableView that covers half the screen in iPad portrait mode. Whenever I click, expand the button that calculates and enlivens the frame of the table supervisor to cover the entire screen, the scrolling becomes very dirty and flickering even with one line. A particularly animated animation seems longer. TableView is masked using autoresizeheight. After I restored the supervisor frame, scrolling the table again becomes smoother. Is there any connection between the start frame of the table and the scroll speed? What are the possible causes of this behavior?

+3
source share
1 answer

You may have pasted the size into your cellForRowAtIndexPath method, so it sets the size of the tableview each time it scrolls. I inserted this piece of code inside the check in viewDidLoad, then the size will be set only once at the beginning and everything will work.

CGPoint tvFrameO = _TableView.frame.origin;
CGSize tvFrameS = _TableView.frame.size;
float valueToResize = 50.0f;
_TableView.frame = CGRectMake(tvFrameO.x, 
                                     tvFrameO.y, 
                                     tvFrameS.width, 
                                     tvFrameS.height + valueToResize);
0
source

All Articles