UIViewController中iOS 7新增的属性

iOS7中UIViewController新增属性

@property(nonatomic,assign) UIRectEdge edgesForExtendedLayout NS_AVAILABLE_IOS(7_0); // Defaults to UIRectEdgeAll
@property(nonatomic,assign) BOOL extendedLayoutIncludesOpaqueBars NS_AVAILABLE_IOS(7_0); // Defaults to NO, but bars are translucent by default on 7_0.  
@property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets NS_AVAILABLE_IOS(7_0); // Defaults to YES
  1. 从iOS7开始,所有的视图控制器采用全屏布局,UIViewController的以下属性已经废弃:
    @property(nonatomic,assign) BOOL wantsFullScreenLayout NS_DEPRECATED_IOS(3_0, 7_0) __TVOS_PROHIBITED; // Deprecated in 7_0, Replaced by the following:
    全屏布局模式下,视图控制器会让它的视图填充整个屏幕,并显示在半透明的系统状态栏下面,而且默认情况下,iOS7会把所有的bar都绘制成半透明,以便显示下面的内容。

  2. UIViewController的edgesForExtendedLayout属性默认值是UIRectEdgeAll,指定控制器将它的视图延伸到屏幕的边缘并在bar下面。如果属性值为:UIRectEdgeNone,控制器视图遇到bar的边界就不延伸了。
    UIViewController的extendedLayoutIncludesOpaqueBars属性可以控制以上属性的有效性,默认值为NO,指定edgesForExtendedLayout在遇到不透明的bar时无效,即不延展。设置值为YES,则在遇到透明或不透明的bar情况下都会延展。

  1. UIViewController的automaticallyAdjustsScrollViewInsets默认为YES,指定控制器在有UIScrollView及其子类并且在有导航栏或工具栏或标签栏情况下,会自动调整其contentInset属性。如果是导航栏contentInset.top = 64,如果是标签栏contentInset.bottom = 44.
    可以将该属性设置为NO,取消这种行为。

你可能感兴趣的:(UIViewController中iOS 7新增的属性)