In iOS 8, it seems that buttons on UIAlertController
(specifically the action sheet type) as well as buttons on the UIActivityViewController
get their color from the main window's tintColor.
How can I change the color of the button text? I've tried using the appearance proxy like this:
[[UIButton appearanceWhenContainedIn:[UIActivityViewController class], nil] setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
But it has no effect. My window's tintColor is white, so the text on the UIActivityViewController buttons is also white, and it cannot be seen. Changing my window's tintColor resolves this issue, but it messes up the rest of the app.
See the screenshot of my UIActivityViewController
with a white cancel button with white text on the bottom:
The same thing applies to UIActionSheet (yes, I know it's deprecated) and UIAlertController with the actionSheet type.
How can I make the text on these windows readable without changing the tintColor of the entire app?? Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…