如何更改MFMessageComposeViewController元素的颜色?

时间:2013-10-16 17:39:37

标签: ios ios7 mfmessagecomposeview

我使用以下内容设置并打开我的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];
    }
}

但屏幕看起来像这样:

enter image description here

那么如何更改数字所在的紫色背景,或者更改数字颜色以及加号颜色?

1 个答案:

答案 0 :(得分:4)

我无法仅更改数字所在的紫色背景,因此我必须更改整个导航栏颜色,以便它适用于数字的背景:

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