我想用 iOS 7 风格创建 iOS 6 应用程序..
到目前为止我可以实现它,最后一个问题是NavigationBarItem的动作按钮,颜色是白色的。
我如何更改文本的背景和颜色是通过在 AppDelegate.m 中添加几行
UIImage *backButtonImage = [UIImage imageNamed:@"button_back.png"];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:(21/255.0) green:(125/255.0) blue:(251/255.0) alpha:1],
UITextAttributeTextColor,
[UIColor clearColor],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Helvetica Neue" size:17.0],
UITextAttributeFont,
nil] forState:UIControlStateNormal];
这button_back.png
实际上是空白图片。我想让背景是空白的。