簡體   English   中英

在MFMailComposeViewController的UINavigationBar中修改tintColor

[英]Modify tintColor in UINavigationBar within MFMailComposeViewController

我正在嘗試為MFMailComposeViewController修改UINavigationBar中的tintColor,但這似乎不起作用。

   [[UINavigationBar appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTintColor:[UIColor whiteColor]];
   [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [MFMailComposeViewController class], nil] setTintColor:[UIColor blackColor]];

在任何人引用蘋果公司的說法“郵件撰寫界面本身不可自定義,並且不能由您的應用程序修改”之前,我以前提交過一個應用程序,該應用程序已存在於App Store中,其中UINavigationBar已以類似方式進行了修改,在審核過程中沒有任何問題。

當我像這樣在整個應用程序中為這些類設置外觀時,它會起作用:

   [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
   [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:[UIColor blackColor];

問題是我不希望這些外觀設置應用於所有UINavigationBar / UIBarButtonItem實例。

我對如何使用AppearanceWhenContainedIn:的理解是否正確? 或者是別的什么?

感謝您一如既往的幫助:)

這似乎是iOS 6.x(我的開放式雷達)中的錯誤-http: //openradar.me/radar?id=2984402

蘋果已經回應了我,它是先前已知錯誤(#12328070)的重復副本,因此應盡快修復。

此代碼將在iOS 5中按預期工作。

為了解決此問題,建議您在創建MFMailComposeViewController時手動應用所需的內容:

MFMailComposeViewController *mailComposerController = [[MFMailComposeViewController alloc] init];

[mailComposerController.navigationBar setTintColor:[UIColor redColor]];

如果我在該主題上發現其他問題,我將更新我的答案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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