简体   繁体   中英

How do I change the color of the MFMessageComposeViewController elements?

I set up and open my MFMessageComposeViewController with the following:

- (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]];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM