I am sharing a text using UIActivityViewController,
And on choosing "Message" from the options listed my screen appears as follows,
But there is a cancel button at right bar button which is white color as assigned in my AppDelegate.
The problem here is I cannot able to update NavigationBar color.
I have tried as follows and none was useful,
let activityVC = UIActivityViewController(activityItems: contents, applicationActivities: nil)
present(activityVC, animated: true) {
activityVC.navigationController?.navigationBar.backgroundColor = UIColor.green
activityVC.navigationController?.navigationBar.tintColor = UIColor.red
MYAppDelegate.customise()
}
or
let activityVC = UIActivityViewController(activityItems: contents, applicationActivities: nil)
present(activityVC, animated: true) {
UINavigationBar.appearance().barTintColor = UIColor.red
UINavigationBar.appearance().tintColor = UIColor.white
let navigationTextAttributes = [NSForegroundColorAttributeName : UIColor.white]
UINavigationBar.appearance().titleTextAttributes = navigationTextAttributes
UIBarButtonItem.appearance().setTitleTextAttributes(navigationTextAttributes, for: .normal)
UIBarButtonItem.appearance().tintColor = UIColor.white
}
How to resolve this issue ?