解决UIScrollView 不能滚动的问题

来源:互联网 发布:背锅侠网络意思 编辑:程序博客网 时间:2024/05/17 02:37

原文地址:http://www.cnblogs.com/woainilsr/archive/2012/02/26/2368902.html


最常见的原因是 
  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 the viewDidLoad method and perform your tasks there.


0 0
原创粉丝点击