簡體   English   中英

在UIPopoverController中更改后退按鈕,導航標題的顏色

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

我已經在UIPopoverController的contentView中添加了UIActivityViewController 並嘗試打開在UIPopoverController本身中導航的Print Option。 我明白了

在此處輸入圖片說明在此處輸入圖片說明

我得到的是標題(打印選項/打印機)的顏色,后退按鈕是白色,我希望它是UIPopoverController 。僅在UIPopoverController情況下。 否則,al很好。

請建議!

對於標題使用:

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

對於后退按鈕的箭頭和文本

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

當然,如果您有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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM