uipopoverpresentationcontroller

Interacting with contents of UIPopoverPresentationController on regular sized iPhones?

本小妞迷上赌 提交于 2019-12-13 03:50:00
问题 It appears - at least by default, that while you can interact with the contents of a popover on a plus iPhone and dismiss it by tapping on the background, on a regular, non plus phone, the behavior is the opposite. Does anyone know how to correct and/or configure this so that you can interact with a popover on an regular iPhone? I have a sample that demonstrates the problem here: https://github.com/chrisco314/iPhone-Popover-Test, but the relevant code is: class PresentingViewController:

iOS中UIPopoverController使用详解

孤街醉人 提交于 2019-12-07 00:15:14
iOS中UIPopoverController使用详解 一、引言 UIPopoverController是Pad设备中常用的一种视图控制器,其在UI表现上为在当前视图控制器上面弹出一个子视图控制器,通常用来展示交互列表。示例如下图: UIPopoverController只能用于iPad,在要兼容iPad和iPhone的项目中,需要根据设备类型使用两套代码。在iOS8之后,系统提供了UIPresentationController来代替她,UIPresentationController可以兼容iPhone与iPad。 二、UIPopoverController的使用详解 首先UIPopoverController是一个容器控制器,其中需要承载一个ViewControler作为内容视图。UIPopoverController使用如下初始化方法创建: //创建视图控制器的方法 通过一个内容视图控制器创建 - (instancetype)initWithContentViewController:(UIViewController *)viewController; 创建出控制器后,调用如下方法可以将控制器弹出: //这个方法将控制器以一个CGRect区域为基准弹出 /* UIPopoverArrowDirection为箭头出现的方向 typedef NS_OPTIONS

how to use popover controller in iPhone

我只是一个虾纸丫 提交于 2019-12-06 02:23:52
问题 I couldn't show popover controller as popover in iPhone whereas it works very well with iPad. Any ideas on how to do that in iPhone. As far as I have searched I couldn't find any. anyways to make the popover appear in iphone as it is in iPad is appreciated ! 回答1: Set yourself as the popover view controller's delegate before presenting it, and implement the delegate method adaptivePresentationStyle(for:traitCollection:) to return .none . This will cause the popover to stop adapting on iPhone

iOS 13 - UIPopoverPresentationController sourceview content visible in the arrow

一世执手 提交于 2019-11-27 07:40:22
问题 When I am displaying some view in UIPopoverPresentationController and presenting it as popover popoverCon?.modalPresentationStyle = UIModalPresentationStyle.popover the content have moved upward toward and a some part is being display in the arrow. Further I had border around the popover popoverCon?.view.layer.borderColor = .orange popoverCon?.view.layer.borderWidth = 1.0; popoverCon?.view.layer.cornerRadius = 10.0; popoverCon?.view.layer.masksToBounds = false; it is not showing toward the