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) セカンドスクリーン(OKではない)、電子メール(OK)による シェア
動作しません。私がテストしたコードを追加しました –
@SjoerdPerforsこれは、この設定を無効にするサードパーティの問題かもしれません。 –