Today, I made a small scrollview example (my environment xcode5 ios7), and found that it could not be rolled. Even if I set the contentsize of scrollview, I did some research, finally, the solution was found: Before ios6, because xcode does not have the autolayout mechanism, you can directly use scrollview and set its contentsize to scroll normally after ios6, because xcode introduces the autolayout mechanism, the contentsize we set is changed to a value suitable for the screen size, that is, adaptive, so it cannot be rolled. The solution is as follows: remove autolayout of scrollview directly, but this method is not perfect. After all, autolayout is officially recommended and easily removed will cause other problems, so use it with caution. In viewcontroller, reload the-(void) viewdidappear :( bool) animated method and set the contentsize. The Code is as follows: Copy code 1 # import "imaginariumviewcontroller. H "2 3 @ interface imaginariumviewcontroller () 4 @ property (weak, nonatomic) iboutlet uiscrollview * scrollview; 5 @ property (weak, nonatomic) iboutlet uiimageview * imageview; 6 @ end 7 8 @ implementation imaginariumviewcontroller 9 10-(void) viewdidappear :( bool) animated11 {12 [Super viewdidappear: animated]; 13 self. scrollview. contentsize = self. imageview. image. size; 14 self. imageview. frame = cgrectmake (0, 0, self. imageview. image. size. width, self. imageview. image. size. height); 15} 16 17 @ end