1.最常見的原因是
contentSize 這個屬性,比uiscrollview的frame要小, 無需滾動, 自然就滾動不了。
scrollenabled 這個屬性,標識着是否允許滾動,要言設成yes
另外還有一些比較隱蔽的原因. 如果這個scrollView是在IB里面生成的話,還得手動設置它的contentSize,並且不能在initWithNibName:bundle:里面設置,因為The nib file you specify is not loaded right away. It is loaded the first time the view controller’s view is accessed. If you want to perform additional initialization after the nib file is loaded, override theviewDidLoad
method and perform your tasks there.