Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios MFMessageComposeViewController';s取消按钮颜色_Ios_Mfmessagecomposeview - Fatal编程技术网

Ios MFMessageComposeViewController';s取消按钮颜色

Ios MFMessageComposeViewController';s取消按钮颜色,ios,mfmessagecomposeview,Ios,Mfmessagecomposeview,我想定制MFMessageComposeViewController,使用导航栏的特定图像和状态栏、导航栏标题和取消按钮的简单白色。我唯一不能做的就是改变取消按钮的颜色。以下是我的实现: [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"NavBar.png"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setTit

我想定制
MFMessageComposeViewController
,使用导航栏的特定图像和状态栏、导航栏标题和取消按钮的简单白色。我唯一不能做的就是改变取消按钮的颜色。以下是我的实现:

[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"NavBar.png"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];

MFMessageComposeViewController *sms = [[MFMessageComposeViewController alloc] init];

if([MFMessageComposeViewController canSendText]){

   sms.body = string;
   sms.recipients = number;
   sms.messageComposeDelegate = self;
   [self presentViewController:sms animated:YES completion:^{

        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    }];
}
我还尝试使用
[sms.navigationBar setTintColor:[UIColor-whiteColor]]但它不起作用

编辑 我终于找到了一个解决方案:只需在最后一个
[UINavigationBar外观]
下添加这行代码:

[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil].tintColor = [UIColor whiteColor];