0

UIActivityViewControllerでWhatsappにテキストを共有すると、共有の2番目の画面に間違ったボタン色が付きます。最初の画面はOKです。この問題は、多くの時間を議論してきたと回答の一つの大きなバケツがここで見つけることができます:私のためにCannot set text color of Send and Cancel buttons in the mail composer when presented from the UIActivityViewController in iOS7UIActivityViewControllerを使用してWhatsappと共有するときに、ボタンにtextColorが表示されない

解答の修正のボタン色:

  • MFMailComposeViewController
  • そして、最初の画面 Whatsapp

ただし、2番目の理由はありません。動作していない

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

しかし、たとえすべてのUIBarButtonItemsの外観を設定する:

[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; 

例のコードが機能していない:

 self.window?.tintColor = UIColor.white 
     let activityController = UIActivityViewController.init(activityItems: items, applicationActivities: nil) 

     if let vc = delegate?.currentViewController() { 
      sender.isEnabled = false 

      vc.present(activityController, animated: true, completion: { 
       sender.isEnabled = true 
      }) 
      activityController.navigationController?.navigationBar.tintColor = UIColor.white 
      activityController.view.tintColor = UIColor.white 

これは、最初の画面の修正をしました

スクリーンショット:

最初の画面(OK) Whatsapp first screen (OK) セカンドスクリーン(OKではない)、電子メール(OK)による Whatsapp second screen (NOT OK) シェア Email (OK)

答えて

1

ちょうど変更してみてくださいUIWindowのtintColorあなたAppdelegate方法didFinishLaunchingWithOptionsインチそれは自動的にすべてのUIView子孫にデフォルトとして自動的に渡されます。

[self.window setTintColor:[UIColor whiteColor]]; 

希望すると、これが役に立ちます。

tintColorを再度設定する(オーバーライドする)サードパーティの問題でもあります。

+0

動作しません。私がテストしたコードを追加しました –

+0

@SjoerdPerforsこれは、この設定を無効にするサードパーティの問題かもしれません。 –

関連する問題