美文网首页
导航栏透明设置

导航栏透明设置

作者: Super_Chester | 来源:发表于2018-05-05 15:28 被阅读0次

在iOS7以后,默认为YES。{控件从(0,0)点开始,设置为NO,则从nav底部(0,64)开始};

显而易见,translucent为默认值YES时,绿色button从屏幕左上角(0,0)开始。translucent设为NO以后,绿色button从(0,64)开始。

也就得出,translucent为YES,控制器view从(0,0)开始;translucent为NO,控制器view从(0,64)开始。

 self.navigationController.navigationBar.translucent =YES;

在translucent为yes的情况,设置一个坐标tableView为(0,0),因为automaticallyAdjustsScrollViewInsets属性默认为yes的关系,tableView会向下偏移64,不被导航栏遮住,如果想要遮住将其设为NO

链接:https://www.jianshu.com/p/428920dd6309

设置标题颜色 :

 [self.navigationController.navigationBar setTitleTextAttributes: @{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];

将导航栏设为透明 :

[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];    

[self.navigationController.navigationBar setShadowImage:[[UIImage alloc]init]];

相关文章

  • 导航栏渐变隐现

    页面不显示导航栏,上托一定的距离显示导航栏. 设置导航栏存在且透明: 1.设置导航栏的透明: //导航栏透明 ...

  • Swift - NavigationBar Tips

    设置导航栏背景色为透明 隐藏导航栏下方的线条 设置导航栏的背景色 设置导航栏背景不为半透明

  • iOS 设置导航栏半透明后添加视图变化

    1.设置导航栏为不透明 2.设置导航栏为半透明 [系统默认就是半透明的]注意:iOS 导航栏如果设置为半透明,则其...

  • 导航栏

    1,设置透明导航栏: 2,设置导航栏颜色(在设置透明后设置barTintColor无效): 尽管设置了透明度但是还...

  • swift-导航栏修改高度

    导航栏直接可以通过frame来改变高度 设置导航栏半透明 设置导航栏背景图片 设置导航栏阴影图片 设置导航栏前景色...

  • iOS设置导航栏样式到AttributeString富文本总结

    一、iOS开发中导航栏设置1.1、导航栏透明的设置方法 1.2设置导航栏背景色 1.3 设置导航栏中titleLa...

  • 设置导航栏颜色, 字体大小

    取出导航栏 设置导航栏背景色 设置标题颜色和字体大小 设置布局从导航栏下开始, 把导航栏设置为不透明 设置状态栏的...

  • 导航栏设置

    设置导航栏某个界面的导航栏透明 (导航按钮显示) 在viewWillAppear里面加两行代码 //设置导航栏背景...

  • iOSAttributeString 属性总结

    一、iOS开发中导航栏设置 1.1、导航栏透明的设置方法 //1.1.1 在具有导航栏的viewControlle...

  • Swift Develop Tips

    1、设置导航栏为透明

网友评论

      本文标题:导航栏透明设置

      本文链接:https://www.haomeiwen.com/subject/skosrftx.html