iOS 7.1黑色导航栏,色彩鲜艳

时间:2014-03-21 00:56:56

标签: ios navigationbar

这就是我的应用程序中的导航栏的样子: enter image description here

这就是我希望它的样子(iTunes App,视频页面): enter image description here

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

这是我到目前为止使用的代码:

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];

1 个答案:

答案 0 :(得分:1)

navigationaBar样式设置为半透明。

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