我使用它是为了通过我的移动应用程序在我的日历上添加事件。 我想要做的是更改导航栏项目的颜色(取消和完成)请检查下图:
有什么建议吗?
最佳答案
使用此代码
[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/