zoukankan      html  css  js  c++  java
  • 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

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

  • 相关阅读:
    C++11 override和final
    C++11 类型推导auto
    C++11 强枚举类型
    C++11 explicit的使用
    《数据结构与算法之美》——冒泡排序、插入排序、选择排序
    《数据结构与算法之美》- 栈
    Spring Boot系列——AOP配自定义注解的最佳实践
    Spring Boot系列——死信队列
    Spring Boot系列——7步集成RabbitMQ
    让我头疼一下午的Excel合并单元格
  • 原文地址:https://www.cnblogs.com/yang-shuai/p/9269636.html
Copyright © 2011-2022 走看看