解决UIScrollView 不能滚动的问题

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.

posted @ 2012-02-26 18:27  woainilsr  阅读(22302)  评论(0编辑  收藏  举报