IOS UITableView how to disable scroll down

I want to disable scroll scans on my UITableView. So far I am doing it like this:

myTableView.bounces = NO;

But when I scroll through the list in my list, my content does not stop, but a little back. How to disable this?

+4
source share
4 answers

Just uncheck the Bounce Vertically UITableView Property checkbox.

enter image description here

You can also do this programmatically by setting the alwaysBounceVertical property to NO

+8
source
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (scrollView.contentOffset.y<=0) {
        scrollView.contentOffset = CGPointZero;
    }
}
+4
source

UITableview UIScrollview. . , scrollview. , , .

+3

UITableView is a subclass of UIScrollView. UIScrollView has a property that you can set to stop bouncing.

There are actually two options:

set the BOOLvalue bouncesto NO.

set the BOOLvalue alwaysBounceVerticalto NO.

Here is a link to the docs.

+2
source

Source: https://habr.com/ru/post/1532273/


All Articles