1

我正在尝试更改 1Password 应用程序扩展中导航栏标题和状态栏项目的颜色。我无法找到一种方法来做到这一点。

请看下图。 在此处输入图像描述

一定有办法做到这一点,优步应用正在这样做。请在下面找到图片。 在此处输入图像描述

有人可以建议我一种方法吗?

4

2 回答 2

0

更改导航栏标题颜色:

self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor grayColor]};

更改状态栏字体颜色:1.在Info.plist中添加项:UIViewControllerBasedStatusBarAppearance NO 在此处输入图像描述

2.在[viewController viewDidLoad]中添加代码

提示:如果您需要更改所有viewController状态字体颜色,您应该添加[AppDelegate application:didFinishLaunchingWithOptions:]

[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
于 2015-06-19T08:56:58.857 回答
0

在呈现 1Password 屏幕之前,将外观设置如下。

[[UINavigationBar appearance] setBarTintColor:nil];
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setTitleTextAttributes: @{NSForegroundColorAttributeName:[UIColor blackColor]}];

在 1Password 的完成块中,将您的外观重置为您的应用特定外观。

于 2015-06-19T10:10:50.827 回答