首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MFMailComposeViewController可以没有presentModalViewController吗?

MFMailComposeViewController可以没有presentModalViewController吗?
EN

Stack Overflow用户
提问于 2009-11-04 11:29:04
回答 2查看 1.8K关注 0票数 1

苹果提供了使用它使用的MFMailComposeViewController.but的代码

代码语言:javascript
复制
- (IBAction)buttonPressed
{

    MFMailComposeViewController *controller = [[MFMailComposeViewController alloc]init];
controller.mailComposeDelegate = self;

[controller setSubject:@"In app email..."];

[controller setMessageBody:@"...a tutorial from mobileorchard.com" isHTML:NO];

[self presentModalViewController:controller animated:YES];

[controller release];

}默认情况下,它使用自下而上的transition.suppose,如果我想使用下面的内容,它会产生错误的输出。,我可以使用其他的添加子视图来代替presentModalViewController

代码语言:javascript
复制
{

    UIViewAnimationTransition  trans =  UIViewAnimationTransitionFlipFromRight;

[UIView beginAnimations: nil context: nil];
[UIView setAnimationTransition:trans forView: [self view] cache: YES];
    [self presentModalViewController: controller animated:YES];
[UIView commitAnimations];
}

它对其他视图控制器是正确的,但是它在MFMailComposeViewController中没有工作--请给我任何帮助?

嗨,我已经这样做了,但是当前视图控制器翻转,然后composer来自底部.?您能帮忙吗?-(IBAction)clickedMailButton:(Id)发件人

代码语言:javascript
复制
{

  if ([MFMailComposeViewController canSendMail])
{ 

      MFMailComposeViewController *mcontroller = [[MFMailComposeViewController alloc]init];
    //[mcontroller setSubject:@"My Pocket Schedule"];
    [mcontroller setTitle:@"New Message"];
    [mcontroller setMessageBody:@"Check out My Pocket Schedule in the iTune Store" isHTML:NO];
    mcontroller.mailComposeDelegate = self;
    UIViewAnimationTransition  trans =  UIViewAnimationTransitionFlipFromRight;
    [UIView beginAnimations: nil context: nil];
    [UIView setAnimationTransition:trans forView: [self view] cache: YES];
    [self presentModalViewController:mcontroller animated:YES];
    [UIView commitAnimations];
    [mcontroller release];
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-11-04 12:16:27

使用modalTransitionStyle属性:

代码语言:javascript
复制
MFMailComposeViewController *mcontroller = [[MFMailComposeViewController alloc] init];
[mcontroller setTitle:@"..."];
[mcontroller setMessageBody:@"..." isHTML:NO];
mcontroller.mailComposeDelegate = self;
mcontroller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:mcontroller animated:YES];
[mcontroller release];
票数 0
EN

Stack Overflow用户

发布于 2009-11-04 12:12:54

试一试

presentModalViewController:withTransition:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1673213

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档