Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
Iphone 如何在MFMailComposer控制器中设置导航项(如发送按钮)的图像_Iphone - Fatal编程技术网

Iphone 如何在MFMailComposer控制器中设置导航项(如发送按钮)的图像

Iphone 如何在MFMailComposer控制器中设置导航项(如发送按钮)的图像,iphone,Iphone,我想在MFMailComposer控制器中设置导航项(发送按钮)的图像,并编写以下代码 [picker.navigationItem.RightBarButtonim setImage:[UIImage ImageName:@“sendbutton.png”] 但它不是改变它。我改变它是因为我的发送按钮不工作使用此代码 UIBarButtonItem *sendBtn=picker.navigationBar.topItem.rightBarButtonItem; UIButton

我想在MFMailComposer控制器中设置导航项(发送按钮)的图像,并编写以下代码

[picker.navigationItem.RightBarButtonim setImage:[UIImage ImageName:@“sendbutton.png”]

但它不是改变它。我改变它是因为我的发送按钮不工作使用此代码

   UIBarButtonItem *sendBtn=picker.navigationBar.topItem.rightBarButtonItem;
   UIButton *btn2=[UIButton buttonWithType:UIButtonTypeCustom];
   btn2.frame=CGRectMake(280, 2, 55, 30);
   [btn2 setImage:[UIImage imageNamed:@"images (2).jpeg"]forState:UIControlStateNormal];
   btn2.backgroundColor=[UIColor clearColor];
   [btn2 addTarget:sendBtn.target action:sendBtn.action forControlEvents:UIControlEventTouchUpInside];
   UIBarButtonItem *btnTemp2=[[UIBarButtonItem alloc]initWithCustomView:btn2];
   [[[[picker viewControllers]lastObject] navigationItem] setRightBarButtonItem:btnTemp2];
但是我的取消按钮有代码

uiBarButtonim*cancelBtn=picker.navigationBar.topItem.LeftBarButtonim;
UIButton*btn1=[UIButton按钮类型:UIButtonTypeCustom];
btn1.frame=CGRectMake(20,2,60,30);
[btn1 setImage:[UIImage IMAGENAME:@“btn_tellAFriend”_cancel@2x.png“]用于状态:uicontrol状态正常]
btn1.backgroundColor=[UIColor clearColor]; [btn1 addTarget:cancelBtn.target操作:cancelBtn.action for ControlEvents:UIControlEventTouchUpInside]
UIBarButtonItem*btnTemp=[[UIBarButtonItem alloc]initWithCustomView:btn1]
[[[picker ViewController]lastObject]navigationItem]SetLeftBarButtonim:btnTemp]; [btnTemp发布]


它工作正常

MFMailComposeViewController发送按钮无法修改,不应根据苹果的要求进行更改

您唯一能做的就是更改MFMailComposeViewController导航栏的颜色,这也将更改发送按钮的颜色

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    [[picker navigationBar] setTintColor:[UIColor redColor]];
试试这个代码

[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navbar_logo.png"]];
[imageView sizeToFit];
imageView.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |
                              UIViewAutoresizingFlexibleRightMargin |
                              UIViewAutoresizingFlexibleTopMargin |
                              UIViewAutoresizingFlexibleBottomMargin);
UIBarButtonItem *loadingView = [[UIBarButtonItem alloc] initWithCustomView:imageView];

loadingView.target = self;
self.navigationItem.rightBarButtonItem = loadingView;

[imageView release];
[loadingView release];

我已经按照上面的方法编写了代码,但我的“发送”按钮没有调用MailComposecController方法。我已经按照上面的方法编写了代码,但我的“发送”按钮没有调用MailComposecController方法,但我在Instagram项目的itunes应用商店中看到了这一点。但长官,我的要求是在导航栏上设置图像和两个按钮,并在控制器按钮发送和取消时正常工作,着色颜色仅更改按钮颜色。我设置了所有颜色,但我的“取消”按钮工作正常,但此处不发送任何工作。Instagram未使用mfmailcomposer,它通过其他进程发送邮件,但其发送外观与mfmailcomposer相同。如果是其他,请告诉我如何执行此操作。