在ios7有时设置了navigationBar的背景图片但是有的时候还是会上去,
NSDictionary *attributes=[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor,[UIFont systemFontOfSize:18],UITextAttributeFont, nil];
IF_IOS7_OR_GREATER(
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_top64"] forBarMetrics:UIBarMetricsDefault];)
else
{
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_top44"] forBarMetrics:UIBarMetricsDefault];
}
[self.navigationController.navigationBar setTitleTextAttributes:attributes];
这时在viewWillAppear中设置
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
不透明就行了
NSDictionary *attributes=[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITextAttributeTextColor,[UIFont systemFontOfSize:18],UITextAttributeFont, nil];
IF_IOS7_OR_GREATER(
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_top64"] forBarMetrics:UIBarMetricsDefault];)
else
{
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_top44"] forBarMetrics:UIBarMetricsDefault];
}
[self.navigationController.navigationBar setTitleTextAttributes:attributes];
这时在viewWillAppear中设置
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
不透明就行了