1. 图片视图上不能直接滚动,须要设置交互属性为YESide
_contentView = [[UIImageView alloc]initWithFrame:CGRectMake(0, _headerView.bottom, kDeviceWidth, kDeviceHeight-20-44-49-_headerView.height-kFooterViewHeight)];ui
_contentView.backgroundColor = [UIColor cyanColor]; _contentView.userInteractionEnabled = YES; [self addSubview:_contentView]; orm
2.contentSize 这个属性,比uiscrollview的frame要小, 无需滚动, 天然就滚动不了。 图片
3.scrollenabled 这个属性,标识着是否容许滚动,要言设成yesci
4.由于AutoLayout的影响 -(void)viewDidLayoutSubviews { self.scrollView.contentSize = CGSizeMake(712,1000); }it
另外还有一些比较隐蔽的缘由. 若是这个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.io