iOS 8 UIActivityViewController and UIAlertController button text color uses window's tintColor
In addition to the global tint color defined for your application, each view controller allows you to override the tint color for just that controller. In this case your best bet would be to set the tintColor on your UIActivityViewController after initializing but before presenting.
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:activities];
//Set the tint color on just the activity controller as needed here before presenting
[activityController.view setTintColor:[UIColor blueColor]];
[self presentViewController:activityController animated:YES completion:nil];
If you are doing this a lot in your app you could use a subclass or a category to avoid code duplication.
How to change UIAlertController button text colour in iOS9?
I've run into something similar in the past and the issue seems to stem from the fact that the alert controller's view isn't ready to accept tintColor
changes before it's presented. Alternatively, try setting the tint color AFTER you present your alert controller:
[self presentViewController:strongController animated:YES completion:nil];
strongController.view.tintColor = [UIColor black];
iOS 8: UIAlertController Default Style Color
Setting the tint colour for the UIAlertController can be done through the appearance API:
[[UIView appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor blackColor]];
UIAlertController bug changing tintcolor of other UIImageViews
Whenever a modal view is presented the tint color of the views behind it are changed to a gray "dimmed" color to indicate that they are not interactive. You should be able to fix this issue by setting the tintAdjustmentMode
property of your UIImageView
s.
See:
UIKit Framework > UIView Class Reference > Configuring a View's Visual Appearance > tintAdjustmentMode
UIActivityViewController: access the navigation items to change color of presented view
Ok. These buttons are not accessible. So I solved the problem as follows:
It's for all UINavigationBar buttons:
UIButton.appearance(whenContainedInInstancesOf: [UINavigationBar.self]).tintColor = .white
It's for all UINavigationBar titles:
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white]
Related Topics
Swift - How to Record Video in Mp4 Format with Uiimagepickercontroller
Change Uiimageview Size to Match Image with Autolayout
Two iOS Apps Using the Same Facebook App Id - Is It Possible
Massive Memory Leak in iOS Uiwebview
Alert View Is Showing White Rectangle in iOS7
Nsinternalinconsistencyexception, Reason: Could Not Load Nib in Bundle
Opengl Es 2.0 to Video on iPad/Iphone
iOS Uiimage Storage Formats, Memory Usage and Encoding/Decoding
App Transport Security Has Blocked a Cleartext Http Resource
How to Draw a Circle Path with Color Gradient Stroke
Create PDF with Multiple Pages
How to Configure Full Urls in Xcconfig Files
Mfmailcomposeviewcontroller in iOS 7 Statusbar Are Black
Xcode 8 Custom Font Doesn't Show Up in Interface Builder
How to Get a Transparent Background in My iOS App So I Can See the Home Screen Wallpaper