@ When we create 2 tableview at the same time in a uiviewcontroller, if you set the Y coordinate of their frame to the same, you may find that their position is not the desired result. For example, the first tableview a frame ( 0,0,320,568), another frame (0,0,320,568), the result is that the first row of data in the second tableview is obscured by the navigation bar, so that we have to change the second frame to (0,64,320,568-64), Although the effect becomes what we want, but do not know what is the reason ....
In fact all this is automaticallyadjustsscrollviewinsets in the mischief, we can first look at the official document in the description of it:
Automaticallyadjustsscrollviewinsets
Specifies whether or not, the view controller should automatically adjust its scroll view insets.
@property (nonatomic, assign) BOOL automaticallyadjustsscrollviewinsets
Discussion
Default value is YES, which allows the view controllers to adjust their scroll view insets in response to the s consumed by the status bar, navigation bar, and toolbar or tab bar. Setto NO if you want to manage scroll view inset adjustments yourself, such as when there are more than one scroll view In the view hierarchy.
Availability
- Available in IOS 7.0 and later.
Declared in
UIViewController.h
Haha, it can be seen, when we have more than one interface TableView and so on, to set it to no, completely by their own manual to layout, will not be confused.
Previous article
[Turn]automaticallyadjustsscrollviewinsets (personally think iOS7 in the nature of the pit dad)