jjzjj

presentedViewController

全部标签

ios - PresentingViewController 如何收到其 PresentedViewController 自行关闭的通知?

给定:呈现ViewControllerB的ViewControllerAViewControllerB没有引用ViewControllerA(隐含的presentingViewController属性除外)ViewControllerB调用dismiss并且什么都不做我想要实现的目标:ViewControllerA想知道ViewControllerB何时被解雇以清理某些状态限制:我不想使用KVO我不想以任何方式修改ViewControllerB或其行为到目前为止我发现了什么:解散(动画:完成:)accordingtothedocumentation将调用转发给它的presentingV

ios - 在 UIWebView 中横向播放 YouTube 视频,而 ViewController 处于纵向

我正在开发一个需要播放YouTube视频的iPhone应用程序。我有一个纵向ViewController,只有一个加载YouTube视频的UIWebView。我想做的是视频可以横向播放。这听起来很简单,但我不知道该怎么做。有人可以帮帮我吗?谢谢! 最佳答案 这在AppDelegate中。仅为视频播放器启用水平模式funcapplication(_application:UIApplication,supportedInterfaceOrientationsForwindow:UIWindow?)->UIInterfaceOrient

ios - XCTest 如何执行呈现模态视图的 segue 并测试 presentedViewController

我试图测试一个会呈现ViewController的转场。但是,它总是失败。如何等待转场完成?请协助。[self.viewControllerperformSegueWithIdentifier:@"mySegueName"sender:self.viewController];XCTAssertNotNil(self.viewController.presentedViewController,@"Failedtoshowmodalview"); 最佳答案 问题是您正试图在UIViewController上呈现,其View不在UIW

ios - UIPresentationController——我可以在呈现后更新呈现的 View Controller 的框架吗?

我正在使用自定义UIPresentationController子类来管理UIViewController的呈现。我正在覆盖-(CGRect)frameOfPresentedViewInContainerView以提供从containerView的边界插入的框架。现在,在对presentedViewController进行一些用户操作后,我想更改presentedViewController的框架。我的问题是:是否有一种“自然”的方式来做到这一点??如何在presentedViewController呈现后调整它的框架? 最佳答案

ios - 使用 XCTest 测试 PresentedViewController

我有我想测试的方法:-(void)sendMailToContact:(Contact*)conact{self.contact=conact;if([selfisSendingAvaiable]){MFMailComposeViewController*mailViewController=[[MFMailComposeViewControlleralloc]init];mailViewController.mailComposeDelegate=self;[mailViewControllersetToRecipients:@[self.contact.email]];[self.

ios - Youtube 视频无法在 iOS 8 中以横向模式播放

我的应用程序包含以横向和纵向模式播放视频的功能。视频可以是youtube,在iOS7之前一切正常,但现在youtube视频在iOS8上无法以横向模式工作。我的代码:-(NSUInteger)application:(UIApplication*)applicationsupportedInterfaceOrientationsForWindow:(UIWindow*)window{if([[window.rootViewControllerpresentedViewController]isKindOfClass:[MPMoviePlayerViewControllerclass]]|

c# - UIImagePickerController 出现 "Attempt to present Xamarin_Forms_Platform_iOS_ModalWrapper whose view is not in the window hierarchy"错误

我有一个基于Xamarin.Forms的应用程序,它在Android和iOS上运行。现在,我正在实现从相机胶卷中选择图像并将其上传到我们的服务器的功能。因此,我正在为发生错误的iOS编写特定于平台的代码。我正在从特定于平台的iOS渲染器调用UIImagePickerController。它正常打开。但是,当在UIImagePickerController中点击图像时,除了VisualStudio在调试控制台中显示一条消息外,什么也没有发生:“警告:尝试在Xamarin_Forms_Platform_iOS_PlatformRenderer:0x153ead6a0上呈现Xamarin_F

ios - 关闭所有当前呈现的 UIAlertControllers

有没有办法关闭当前显示的所有UIAlertController?这是因为在我的应用程序的任何地方和任何状态下,我都需要在按下推送通知时到达某个ViewController。 最佳答案 funcdismissAnyAlertControllerIfPresent(){guardletwindow:UIWindow=UIApplication.shared.keyWindow,vartopVC=window.rootViewController?.presentedViewControllerelse{return}whiletopVC

ios - 如果调用另一个 Alert Controller 以显示,则删除 Alert Controller

我的应用需要在不同时间向用户显示一些信息。我决定使用AlertControllers但我不能同时显示两个AlertControllers。因此我需要知道是否显示了警报Controller,关闭它并打开另一个。到目前为止我已经做到了。我正在使用self.presentedViewController检查是否显示了AlertController。但我不知道如何关闭它。我试过self.presentedViewController?.removeFromParentViewController()和self.presentedViewController?.delete(self.prese

swift - iOS 8 : Applying a UIVisualEffectView with Blur Effect to a Modal PopOver in Compact Mode

我正在尝试制作一个类似于2014年WWDC第214次session中的弹出窗口。因此,我开始使用IB构建我的应用程序,该IB具有通过“PresentAsPopover”segue连接的两个View,如下所示:弹出View包含一个填充其父View的TextView,具有以下约束:为了支持模态弹出框,代码如下:funcadaptivePresentationStyleForPresentationController(controller:UIPresentationController)->UIModalPresentationStyle{return.OverFullScreen}fu
12