一些常用的属性详解

1.将tableView显示在NavigationBar下面 

tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);

tableView.scrollIndicatorInsets = tableView.contentInset;

等价于:

  self.automaticallyAdjustsScrollViewInsets = YES

2.edgesForExtendedLayout:

它是一个类型为UIExtendedEdge的属性,指定边缘要延伸的方向,它的默认值很自然地是UIRectEdgeAll,四周边缘均延伸,就是说,如果即使视图中上有navigationBar,下有tabBar,那么视图仍会延伸覆盖到四周的区域。因为一般为了不让tableView 不延伸到 navigationBar 下面, 属性设置为 UIRectEdgeNone

self.navigationController.navigationBar.translucent = NO;

原文地址:https://www.cnblogs.com/qitiandasheng/p/5496616.html