【问题标题】:Presenting and hiding popovers on iPads with animation使用动画在 iPad 上呈现和隐藏​​弹出框
【发布时间】:2015-07-04 12:17:41
【问题描述】:

我正在寻找一种使用淡入/淡出动画在我的应用程序中呈现和隐藏​​弹出框的方法。有可能吗?

【问题讨论】:

  • 你是说你想做一个自定义动画而不是默认的弹出框动画?

标签: ios ios7 ios8 uipopover


【解决方案1】:
PopOverDesignController *objPopOverDesignController = [[PopOverDesignController alloc] initWithNibName:@"PopOverDesignController" bundle:nil];
    UIPopoverController *popController = [[UIPopoverController alloc] initWithContentViewController:objPopOverDesignController];
    popController.delegate = self;
    popController.popoverContentSize = objCategoriesViewController.view.frame.size;

    [popController  presentPopoverFromRect:CGRectMake(130,970,100,100)
                                         inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];



[popController dismissPopoverAnimated:YES];

【讨论】:

    【解决方案2】:

    如果您想淡入/淡出您的弹出框,您需要在控制器中使用 modalTransitionStyle 属性将模态过渡样式设置为 CrossDissolve

    斯威夫特

    vc.modalTransitionStyle =  UIModalTransitionStyle.CrossDissolve
    

    目标 c

    vc.modalTransitionStyle.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    

    其中 vc 是您要呈现的视图控制器

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-06
      • 1970-01-01
      • 1970-01-01
      • 2014-12-18
      • 1970-01-01
      • 2015-12-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多