[IOS] edgesForExtendedLayout, automaticallyAdjustsScrollViewInsets, and scrolllayout

Source: Internet
Author: User

[IOS] edgesForExtendedLayout, automaticallyAdjustsScrollViewInsets, and scrolllayout

After IOS7, ViewController starts to use full screen layout, and the default behavior usually involves layout.

EdgesForExtendedLayout is an attribute of the uiextendedge type,

Specify the direction of the edge to be extended. The default value is UIRectEdgeAll, and the surrounding edge is extended, that is,

If the view contains navigationBar and tabBar, the view will extend to the surrounding area.

This attribute is set to UIRectEdgeNone to prevent tableView from extending to the navigationBar.

UIRectEdgeAll -- default


UIRectEdgeNone


The navigation bar will be grayed out, and the processing will be OK as follows

Self. navigationController. navigationBar. translucent = NO;


What about automaticallyAdjustsScrollViewInsets?

When automaticallyAdjustsScrollViewInsets is NO, tableview starts from the top of the screen, that is

Navigation Bar & Status Bar coverage



When automaticallyAdjustsScrollViewInsets is set to YES, it is also the default behavior, and the performance is normal.

What is the difference between edgesForExtendedLayout = UIRectEdgeNone? Inattention may be hard to perceive

Designers can see right at a glance... When automaticallyAdjustsScrollViewInsets is YES,

When the table view slides up and down, it can pass through the navigation bar and the status bar, and there is a light red below them


ExtendedLayoutIncludesOpaqueBars

First, let's take a look at the official explanation. The default value is NO, but the default attribute of Bar is transparent... That is to say, it is useful only when it is not transparent.

However, the test results are very weak, and the basic difference is not big... But it still works to solve some bugs, such as the SearchBar

Runout problem, see: http://www.cnblogs.com/skyming/p/4059128.html, other UITableView, UIScrollView location

Most of the problems are related to these three attributes ..



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.