iOS 8 Uiactivityviewcontroller and Uialertcontroller Button Text Color Uses Window's Tintcolor

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 UIImageViews.

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



Leave a reply



Submit