// 设置导航背景图片 (一旦设置背景图片(变为不透明),透明层不起做用)安全
[self.navigationBar setBackgroundImage:[UIImage imageNamed:@"icon_app_nav"] forBarMetrics:UIBarMetricsDefault];app
// navigationBar背景色(经过透明层会显示)字体
// self.navigationBar.backgroundColor = [UIColor yellowColor];图片
// 设置背景颜色(在透明层之上)it
// [self.navigationBar setBarTintColor:ThemeColor];io
// 设置title标题中的颜色(title字体颜色)scroll
UIFont *font = PingFangMediumFontSize(18.f);方法
[self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:font}];im
// 设置返回按钮的颜色 (navigationBarItem字体颜色)call
[self.navigationBar setTintColor:[UIColor whiteColor]];
// 设置导航栏透明 (yes 透明 no 不透明)
self.navigationBar.translucent = NO;
/************************导航相关****************************/
// (导航不透明,控制器View(0,64)开始)
// (导航透明,edgesForExtendedLayout = UIRectEdgeAll,控制器View(0,0)开始)
// (导航透明,edgesForExtendedLayout = UIRectEdgeNone,控制器View(0,64)开始)
// 1.导航不透明 设置self.edgesForExtendedLayout = UIRectEdgeAll,控制器View(0,64)开始
// 2.导航不透明 设置self.edgesForExtendedLayout = UIRectEdgeNone,控制器View(0,64)开始
// 3.导航透明 设置self.edgesForExtendedLayout = UIRectEdgeAll,控制器View(0,0)开始
// 4.导航透明 设置self.edgesForExtendedLayout = UIRectEdgeNone,控制器View(0,64)开始
// automaticallyAdjustsScrollViewInsets = YES (是否自动适应滚动视图的内边距)
// (iOS11此方法过时,scrollView的contentInsetAdjustmentBehavior属性取代)
// scrollView会自动计算和适应顶部和底部的内边距而且在scrollView 不可滚动时,也会设置内边距.
// UIScrollViewContentInsetAdjustmentAutomatic
// 自动适应边距
// UIScrollViewContentInsetAdjustmentScrollableAxes,
// 和automaticallyAdjustsScrollViewInsets=NO有着一样的效果,不计算内边距
// UIScrollViewContentInsetAdjustmentNever,
// 根据safeAreaInsets (安全区域)计算内边距
// UIScrollViewContentInsetAdjustmentAlways
/************************导航相关****************************/