Milor8 Milor8 - 1 year ago 54
iOS Question

how to make uitableview can not to be pulled when scrolled at the top

By default, the uitableview still can be pulled when scrolled at the top if it,
I want to make the uitableview can not to be pulled when it's first cell scroll to the top of it.(Like AppStore)

code

tableView.bounces = NO;
make scrolling not smooth, so it is not what I want.

Answer Source

Use the alwaysBounceVertical property:

tableView.alwaysBounceVertical = NO;

From Apple's Documentation, "A Boolean value that determines whether bouncing always occurs when vertical scrolling reaches the end of the content."

If you're using a xib or storyboard you can also uncheck the "Bounce Vertically" property of the scroll view in the Attributes Inspector:

Bounce Vertically