11

How can I simply let the scrollview bounce, when the content size is smaller than the view's frame and when I drag it?

like iPhone's app search results.

skaffman
  • 398,947
  • 96
  • 818
  • 769
boreas
  • 1,041
  • 1
  • 15
  • 30

3 Answers3

30

see UIScrollView (paging mode) bounces only when there two or more pages?

you'd better set the property:

scroll.alwaysBounceVertical = YES;
scroll.alwaysBounceHorizontal = YES;
Community
  • 1
  • 1
eternity
  • 473
  • 5
  • 8
4

answer myself: the simplest way would be to set the height of the content size to be the height of the frame plus 1. kind of stupid but according to document it only scrolls when size is bigger than frame.

boreas
  • 1,041
  • 1
  • 15
  • 30
4

If you prefer .xib just check Bounce Vertically.

enter image description here

Kamil Harasimowicz
  • 4,684
  • 5
  • 32
  • 58