iOS7 use ScrollView to slide the picture horizontally, automatically creating offset vertical offset problem
Red is ScrollView background color, after adding a picture on the ScrollView, there will always be a downward offset
Setting Contentoffset doesn't work either.
In iOS7, the controller has a
Automaticallyadjustsscrollviewinsets property, default = Yes
if (ios7&&[self respondstoselector: @selector (automaticallyadjustsscrollviewinsets)]) { Self.automaticallyadjustsscrollviewinsets = NO;}
@property (nonatomic, assign) BOOL automaticallyadjustsscrollviewinsets |
Description |
Specifies whether or not, the view controller should automatically adjust its scroll view insets. |
Default value Isyes, which allows the view controller to adjust their scroll view insets in response to the screen areas con Sumed by the status bar, navigation bar, and toolbar or tab bar. Set Tonoif want to manage scroll view inset adjustments yourself, such as when there are more than one scroll view in T He view hierarchy. |
Availability |
IOS (7.0 and later) |
iOS7 use ScrollView to slide the picture horizontally, automatically creating offset vertical offset problem