ios 在出现事件套件时更改导航栏项目的颜色

标签 ios xcode navbar eventkit

我使用它是为了通过我的移动应用程序在我的日历上添加事件。 我想要做的是更改导航栏项目的颜色(取消和完成)请检查下图:enter image description here

有什么建议吗?

最佳答案

使用此代码

[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];

如果您要呈现 UIViewController,请使用以下代码:

创建一个UIBarButtonItem

UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(cancelButtonTapped:)];

[barButton setTintColor:[UIColor whiteColor]];

如果您使用 Apple 提供的 UIViewController 则此代码:

  UIImagePickerController *controller = [[UIImagePickerController alloc] init];
        [controller setDelegate:self];
        [controller setSourceType:UIImagePickerControllerSourceTypePhotoLibrary | UIImagePickerControllerSourceTypeSavedPhotosAlbum];
        [controller.navigationBar setTintColor:[UIColor redColor]];

关于ios 在出现事件套件时更改导航栏项目的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25053852/

相关文章:

ios - 从手动安装转移到通过 Xcode 中的 Cocoapods 使用 Realm

ios - 如何为 iPad 应用程序创建甘特图 View ?

ios - withSecurityScope 在 NSURL.BookmarkCreationOptions 中不可用

iphone - 适用于 iOS 4 应用程序的 Xcode 4.2 模板

ios - 在 iOS 设备上运行 swift 应用程序时出现 THREAD 1 : EXC_BREAKPOINT (code = EXC_ARM_BREAKPOINT. ..) 错误

iphone - 导航堆栈中的某些 UIViewController 中未显示选项卡栏

ios - iOS 8 Today Extension 的最大高度?

html - 将导航栏切换按钮向右对齐

html - 当我滚动时,我的主 Logo 横幅出现在我的导航栏中

css - 我如何使用 min-width 100% 并仍然按内容扩展?