简体   繁体   English

如何更改MFMessageComposeViewController元素的颜色?

[英]How do I change the color of the MFMessageComposeViewController elements?

I set up and open my MFMessageComposeViewController with the following: 我使用以下命令设置并打开我的MFMessageComposeViewController:

- (void)openSMSViewWithRecipientsArray:(NSArray *)recipients {
    MFMessageComposeViewController *messageVC = [MFMessageComposeViewController new];

    if([MFMessageComposeViewController canSendText]){
        messageVC.body = @"";
        [[messageVC navigationBar] setTintColor:[UIColor whiteColor]];
        messageVC.recipients = recipients;
        messageVC.messageComposeDelegate = self;
        [self presentViewController:messageVC animated:YES completion:nil];
    }
}

But the screen looks like this: 但屏幕看起来像这样:

在此输入图像描述

So how do I change either the purple background where the numbers are, or change the number colors along with the plus sign color? 那么如何更改数字所在的紫色背景,或者更改数字颜色以及加号颜色?

I couldn't change only the purple background where the numbers were, so I had to change the whole nav bar color so it would apply to the background of the numbers: 我无法仅更改数字所在的紫色背景,因此我必须更改整个导航栏颜色,以便它适用于数字的背景:

- (void)setNavBarColor:(UIColor *)navBarColor titleColor:(UIColor *)titleColor {
    [[UINavigationBar appearance] setBarTintColor:navBarColor];
    [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                          [UIFont fontWithName:@"Futura-Medium" size:17.0f],
                                                          UITextAttributeFont,
                                                          titleColor,
                                                          UITextAttributeTextColor,
                                                          nil]];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在MFMessageComposeViewController的搜索栏中访问“+”添加按钮的颜色 - How do I access to color of '+' add button in searchbar of MFMessageComposeViewController 如何更改MFMessageComposeViewController的导航栏颜色? - How to change the Navigation Bar color for a MFMessageComposeViewController? 如何在 mfmessagecomposeviewcontroller 中更改导航栏的颜色,同时在 ios 9 中显示它 - How to change color of navigation bar in mfmessagecomposeviewcontroller while presenting it in ios 9 如何更改 MFMessageComposeViewController 的标题? - How does one change the title of MFMessageComposeViewController? 在swift中如何更改SKSpriteNode的颜色? - In swift how do I change the color of a SKSpriteNode? 如何在 Swift 中更改 UIDatePicker 的颜色? - How do I change the color a UIDatePicker in Swift? 如何在UIActivityViewController中更改文本颜色和图标颜色 - How do I change the text color and icon color in UIActivityViewController 移动滑块时如何更改按钮的背景色? - How do I change the background color of a button as I move a slider? 如何在iOS中更改部分透明图像的颜色? - How do I change a partially transparent image's color in iOS? 如何在运行时以编程方式更改UITableViewCells文本颜色 - How do I programatically change UITableViewCells text color at runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM