gpt4 book ai didi

objective-c - 如何更改 MFMailComposeViewController 文本和按钮图像的颜色?

转载 作者:太空狗 更新时间:2023-10-30 03:38:29 26 4
gpt4 key购买 nike

iOS 对 MFMailComposeViewController 中的所有彩色文本使用标准(蓝色)色调。这对我不利,因为客户希望在应用程序中使用他公司的颜色。如何将它们的颜色更改为橙​​色?

我特别询问按钮图标的颜色(添加图像和铃铛图像)和包含邮件地址的文本。我已经更改了导航栏颜色。在文档中,写着:

The view hierarchy of this class is private and you must not modify it. You can, however, customize the appearance of an instance by using the UIAppearance protocol.

我试过使用它,但它不起作用(我可能用错了方法,因为我不知道 UIAppearance)。这是我尝试过的:

        [[UIButton appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];

[[UILabel appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setTextColor:[UIColor orangeColor]];

enter image description here

最佳答案

正如 Apple 所说:https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMailComposeViewController_class/index.html

The view hierarchy of this class is private and you must not modify it. You can, however, customize the appearance of an instance by using the UIAppearance protocol.

无论如何,你可以看看这个帖子: Customizing automatic MFMailComposeViewController opened from UITextView

关于objective-c - 如何更改 MFMailComposeViewController 文本和按钮图像的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29771633/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com