[Turn]automaticallyadjustsscrollviewinsets (personally think iOS7 in the nature of the pit dad)

Source: Internet
Author: User

@ 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.