iOS与导航相关的都在这

    // 设置导航背景图片 (一旦设置背景图片(变为不透明),透明层不起作用)

    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"icon_app_nav"] forBarMetrics:UIBarMetricsDefault];

 

    // navigationBar背景色(通过透明层会显示)

//    self.navigationBar.backgroundColor = [UIColor yellowColor];

    

    // 设置背景颜色(在透明层之上)

//    [self.navigationBar setBarTintColor:ThemeColor];

    

    // 设置title标题中的颜色(title字体颜色)

    UIFont *font = PingFangMediumFontSize(18.f);

    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:font}];

    

    // 设置返回按钮的颜色 (navigationBarItem字体颜色)

    [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

 

/************************导航相关****************************/

posted @ 2018-07-05 17:38  HEJJY  阅读(158)  评论(0编辑  收藏  举报