我正在尝试更改 1Password 应用程序扩展中导航栏标题和状态栏项目的颜色。我无法找到一种方法来做到这一点。
请看下图。
一定有办法做到这一点,优步应用正在这样做。请在下面找到图片。
有人可以建议我一种方法吗?
我正在尝试更改 1Password 应用程序扩展中导航栏标题和状态栏项目的颜色。我无法找到一种方法来做到这一点。
请看下图。
一定有办法做到这一点,优步应用正在这样做。请在下面找到图片。
有人可以建议我一种方法吗?
更改导航栏标题颜色:
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor grayColor]};
更改状态栏字体颜色:1.在Info.plist中添加项:UIViewControllerBasedStatusBarAppearance NO
2.在[viewController viewDidLoad]中添加代码
提示:如果您需要更改所有viewController状态字体颜色,您应该添加[AppDelegate application:didFinishLaunchingWithOptions:]
[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
在呈现 1Password 屏幕之前,将外观设置如下。
[[UINavigationBar appearance] setBarTintColor:nil];
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setTitleTextAttributes: @{NSForegroundColorAttributeName:[UIColor blackColor]}];
在 1Password 的完成块中,将您的外观重置为您的应用特定外观。