• 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

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

  • 相关阅读:
    SQL SERVER批量/单个修改表的所有者
    设置电脑右下角显示自己的大名
    javascript 事件查询 综合
    电脑命令大全值得珍藏
    仿flash超炫焦点图播放器 · javascript for jquery
    VirtualBox使用本地硬盘分区的权限问题
    同步时间并更新到计算机
    linux下电子词典里的扩展存储卡不能访问到的问题
    virtualbox 3.0.4终于可以共享剪贴板了
    批量更改mp3文件ID3编码的脚本
  • 原文地址:https://www.cnblogs.com/yang-shuai/p/9269636.html
Copyright © 2020-2023  润新知