【问题标题】:iOS 7.1 Black Nav Bar with bright colorsiOS 7.1 黑色导航栏,色彩鲜艳
【发布时间】:2014-04-28 04:44:54
【问题描述】:

这是我应用中导航栏的外观:

这就是我想要的样子(iTunes 应用程序,视频页面):

如何在导航栏中实现这种明亮的彩色模糊效果?

这是我目前使用的代码:

navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5];
navigationController.navigationBar.tintColor = [UIColor colorWithRed:88.0/255.0 green:204.0/255.0 blue:249.0/255.0 alpha:1.0];
navigationController.navigationBar.translucent=YES;
NSDictionary *navbarTitleTextAttributes =  [NSDictionary dictionaryWithObjectsAndKeys:
                                            [UIColor colorWithRed:1 green:1 blue:1 alpha:1.0],UITextAttributeTextColor,
                                            [UIColor clearColor], UITextAttributeTextShadowColor,
                                            [NSValue valueWithUIOffset:UIOffsetMake(-1, 0)], UITextAttributeTextShadowOffset, nil];
[[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes];

【问题讨论】:

    标签: ios navigationbar


    【解决方案1】:

    navigationaBar 样式设置为半透明。

    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    self.navigationController.navigationBar.translucent = YES;
    

    【讨论】:

    • 要添加到这个答案,默认模糊效果仅适用于具有背景颜色的条形图。如果您设置背景图像,它不会有模糊(如果它是半透明的,它只会有常规的半透明)。导航栏中的颜色饱和度也存在一些问题。更多信息herehere
    • 是的,就是这样,“UIBarStyleBlack”帮我做了?非常感谢!
    猜你喜欢
    • 2017-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多