4
UIActivityViewControllerを作成していて、共有メッセージのアイコンをタップした後にテキストの色を変更しようとしています。デフォルトではUIActivityViewControllerナビゲーションバーのテキストの色を変更します。
、私はそれをデフォルト(つまり、黒のタイトルテキスト、および青Cancel
作りたいだけUIActivityViewControllerためしかしそう
UINavigationBar.appearance().tintColor = whiteColor
UIBarButtonItem.appearance().tintColor = whiteColor
ようAppDelegate
に白に私のナビゲーションバーのテキストの色を設定しましたボタン)私は運に次のことを試してみました
:
let shareText = "text to share"
let activityViewController = UIActivityViewController(activityItems: [shareText], applicationActivities: [])
activityViewController.navigationController?.navigationBar.tintColor = UIColor.black
activityViewController.navigationController?.navigationItem.rightBarButtonItem?.tintColor = UIColor.blue
present(activityViewController, animated: true, completion: nil)
結果はまだ同じWiあります白いテキスト:
画像をよく見ると、ナビゲーションバーのタイトルバーと右バーボタンの項目に白いテキストが表示されます。
使用UINavigationBar.appearance()が存在し、UINavigationBar.appearanceながらtintColor =黒。 ().tintColor = whiteColorを終了します。 – KKRocks
存在するかどうかはどのように判断するのですか? – Simon
色を決定するために必要なものは? – KKRocks