我正在使用UIActivityViewController在iOS7中共享项目.当我点击"邮件"选项时,它会弹出邮件编辑器,但导航栏上的"取消"和"发送"按钮以及导航栏本身都是蓝色的,这使得它很难阅读,所以我想改变它们的颜色.它在iOS6中工作,但在iOS7中不工作.
我试过了
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], UITextAttributeTextColor, [UIColor clearColor], UITextAttributeTextShadowColor, nil] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)
哪个适用于iOS6,我试过了
[[UIBarButtonItem appearance] setTintColor:[UIColor redColor]];
[[UINavigationBar appearance] setBarTintColor:[UIColor redColor]];
Run Code Online (Sandbox Code Playgroud)
这会导致颜色在第一次运行应用程序时闪烁红色,然后立即切换回蓝色.