简体   繁体   English

在UIPopoverController中更改后退按钮,导航标题的颜色

[英]Change colour of Back Button, Navigation Title in UIPopoverController

I have added the UIActivityViewController in the contentView of UIPopoverController . 我已经在UIPopoverController的contentView中添加了UIActivityViewController And trying to open Print Option which is navigating in UIPopoverController itself. 并尝试打开在UIPopoverController本身中导航的Print Option。 I am getting that view 我明白了

在此处输入图片说明在此处输入图片说明

And I am getting the color of Title (Print Options / Printer) and back button is white , I want it to blue.this is only in case of UIPopoverController . 我得到的是标题(打印选项/打印机)的颜色,后退按钮是白色,我希望它是UIPopoverController 。仅在UIPopoverController情况下。 Otherwise al is fine. 否则,al很好。

Please suggest !!! 请建议!

For the Title use: 对于标题使用:

[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor blueColor]}];

For the arrow and text of back button: 对于后退按钮的箭头和文本

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

And of course if you have an object of UIPopoverController you have to apply the styles from navigation bar: 当然,如果您有UIPopoverController对象,则必须从导航栏中应用样式:

popoverController.navigationBar.titleTextAttributes = self.navigationController.navigationBar.titleTextAttributes;

在该控制器的viewDidLoad方法中:

 for (UIView *subview in self.navigationController.navigationBar.subviews) [subview setTintColor:[UIColor blueColor]];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击“后退”按钮时,导航堆栈中的VC的UINavigationBar标题颜色不变 - UINavigationBar title colour for VCs in a navigation stack doesn't change when back button is clicked [ios]更改导航栏上后退按钮的标题 - [ios]change title of back button on navigation bar 更改导航项后退按钮标题 - Change navigation item back button title UIPageViewController更改导航栏后退按钮标题 - UIPageViewController change navigation bar back button title 如何从情节提要中更改UINavigationBar标题和后退按钮的颜色? - How to change UINavigationBar Title and Back Button Colour from Storyboard? 更改UIPopoverController颜色(和后退按钮颜色) - Change UIPopoverController color (and back button color) 如果点击后退按钮,导航栏标题颜色不会改变 - Navigation bar title color does not change if back button is tapped 如何更改导航栏上“后退”按钮的标题 - How do I change the title of the "back" button on a Navigation Bar 当导航栏的颜色在不同的View Controller中变化时,如何更改后退按钮的颜色? - How to change the colour of the back button when the colour of the navigation bar changes across different View Controllers? 不删除导航后退按钮标题 - Not Remove Navigation back button title
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM