jjzjj

uipopoverpresentationcontroller

全部标签

ios - 使用 UIPopoverPresentationController 时如何为 preferredContentSize 设置动画?

我能够通过简单地设置preferredContentSize成功地改变我呈现的弹出窗口的框架。我现在想为内容大小的变化设置动画,但我没有成功。它只是立即更新,事实上我设置的延迟甚至没有得到尊重。如何动画化内容大小的变化?//InviewDidAppear:UIView.animateWithDuration(5,delay:3,usingSpringWithDamping:0.5,initialSpringVelocity:0.25,options:UIViewAnimationOptions.CurveEaseInOut,animations:{()->Voidinself.pref

ios - UIPopoverPresentationController 动画 preferredContentSize

我正在使用UIPopoverPresentationController将我的tableViewController呈现为PopOver。我可以将其preferredContentSize更改为tableViewcontentSize,如下所示,-(void)viewDidAppear:(BOOL)animated{[superviewDidAppear:animated];self.preferredContentSize=self.tableView.contentSize;}这里的问题是contentSize正在立即更改,这看起来不太好。我试着像this一样制作动画但它不起作用。

ios - AutoLayout 约束和 UIPopoverPresentationController

AutoLayout似乎每一步都在与View大小作斗争。我有一个用于用户输入的ViewController,而AutoLayout似乎坚定不移地决定让我的View高667像素。我尝试过许多布局设置变体、许多内容压缩和抗压缩组合,无论我做什么,AutoLayout都能找到一种将View拉伸(stretch)到667像素高的方法。我使用Reveal,一个显示布局框架、约束等的应用程序(revealapp.com)它向我展示了UIPopoverPresentationController正在添加它自己的自动调整大小约束。这是我的View在呈现时的大致外观......请注意,即使我将“接受”U

ios - UIPopoverPresentationController 不调用 UIAdaptivePresentationControllerDelegate 方法

我尝试通过UIPopoverPresentationController在iPad上呈现弹出窗口。一切都很好,但似乎没有调用UIAdaptivePresentationControllerDelegate的方法。AddRewardController*addRewardVC=[[AddRewardControlleralloc]initWithNibName:@"AddRewardController"bundle:nil];addRewardVC.modalPresentationStyle=UIModalPresentationPopover;addRewardVC.preferr

ios - 来自 UITableViewCell 中的按钮的 UIPopoverPresentationController

在我的应用程序中,我有一个UITableView,它的一个单元格中有一个UIButton。这个按钮有一个Action:-(IBAction)showPopover:(UIButton*)sender{ChoseOptionsViewController*contentController=[[ChoseOptionsViewControlleralloc]init];contentController.modalPresentationStyle=UIModalPresentationPopover;UIPopoverPresentationController*copvc=conte

ios - "UIPopoverPresentationController presentationTransitionWillBegin"使用 UIPopoverController 时崩溃

当我通过点击主Controller上的条形按钮项目然后旋转View打开弹出窗口时,我遇到了以下崩溃。"NSGenericException:UIPopoverPresentationControllershouldhaveanon-nilsourceVieworbarButtonItemsetbeforethepresentationoccurs."我在这里看到了类似的崩溃-UIActivityViewControllercrashingoniOS8iPads,但我没有在代码中的任何地方直接使用“UIPopoverPresentationController”。我的主Controlle

ios - 崩溃日志表明应用程序在我的应用程序中不存在的 UIPopoverPresentationController 方法上崩溃

我收到的崩溃日志表明我的应用程序在[UIPopoverPresentationControllerpresentationTransitionWillBegin]上崩溃,但我的代码中没有任何地方使用UIPopoverPresentationController。这些都在iPad上,我使用了一个UIDocumentInteractionController,它看起来很相似,也许它是UIPopoverPresentationController的子类,我不知道。知道是什么原因造成的吗?ExceptionType:EXC_CRASH(SIGABRT)ExceptionCodes:0x0000

ios - 如何更改 UIPopoverPresentationController 后面的叠加层的不透明度?

我正在使用UIPopoverPresentationController在iOS应用程序中呈现弹出窗口。当它出现时,我想调暗弹出窗口后面的背景。我怎样才能做到这一点?某处是否有它的API,或者当我显示弹出窗口时我是否必须在主视图上覆盖一些东西? 最佳答案 在swift3中,您可以访问叠加层:extensionUIPopoverPresentationController{vardimmingView:UIView?{returnvalue(forKey:"_dimmingView")as?UIView}}将Controller设置为

ios - 使用任何手势关闭 UIPopoverPresentationController,而不仅仅是点击

所以我有一个显示一些内容的简单UIPopoverPresentationController。用户可以通过点击屏幕上的任意位置来关闭它(默认弹出行为)。如果用户在屏幕上进行任何类型的点击或手势,我希望弹出窗口被关闭。最好是拖动手势。知道这是否可能吗?以及如何? 最佳答案 尝试使用touchesBegan:withEvent方法overridefunctouchesBegan(touches:Set,withEventevent:UIEvent?){iflettouch=touches.first{iftouch.view==self

ios - 当弹出窗口在屏幕上时,UIBarButtonItem 不会脱色/禁用

我有两个UIBarButtonItems在我的导航Controller上:segmentControl=UISegmentedControl(items:["Up","Down"])infoItem=UIBarButtonItem(image:infoImage,style:.plain,target:self,action:#selector(infoAction))navigationItem.rightBarButtonItems=[infoItem,UIBarButtonItem(customView:segmentControl)]点击infoItem时我这样做:@objcf