uipopovercontroller

Set shouldAutorotate to false with Photolibrary

女生的网名这么多〃 提交于 2019-12-07 02:48:20
问题 If I add a popover with access to my photo gallery from the iPad the system always crash with the following message: Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES' But I already set up in my Projekt Information just to support Landscape Mode. So I added the following function override func shouldAutorotate()

Dismissing Popover, [UIPopoverController dealloc] reached while popover is still visible

旧时模样 提交于 2019-12-07 02:35:52
问题 I have a UIPopoverController stored in a strong property in my View Controller. When the user rotates the iPad while the popover is visible, I dismiss the popover and set my property to nil. if (self.popover != nil) { [self.popover dismissPopoverAnimated:NO]; self.popover.delegate = nil; self.popover = nil; } When the code gets to self.popover = nil, ARC attempts to dealloc the UIPopoverController, but it crashes because it is supposedly still visible. How am I supposed to dismiss and nil out

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

Don't Dismiss UIPopoverController when tap off

走远了吗. 提交于 2019-12-06 17:46:41
问题 after a bit of searching, I couldn't find an answer to something that seems like it would be useful to many. Is there a way to make a UIPopoverController not dismiss when the user clicks somewhere on the outside? I want the user to have to use a cancel button (Yes, i realize this probably violates Apple's HIG somehow, but it's a rare case and makes sense from a User experience perspective). Thanks for any help. 回答1: You can do hit-tests on where the tap occurred and in your popover's delegate

POP-UP UIView “IMDB App” style [closed]

我们两清 提交于 2019-12-06 16:58:30
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Is there an easy way to accomplish this kind of pop-up window (like there is with UIPopoverController) or should I build it from scratch? http://dl.dropbox.com/u/1898217/la-foto.jpg 回答1: You can make something

how to present modal UIViewController dialog from bottom in IOS like this (image attached)

独自空忆成欢 提交于 2019-12-06 16:09:08
问题 How would one present a UIViewController (from Storyboard say) that is modal, and slides up from the bottom of the presenting view controller. Requirements would be: slides up from bottom, with widths aligning with the width of the presenting view controller does NOT take up whole screen or whole parent presenting view controller (rather only is as high as required to show itself) can be shown within the context of a view controller which doesn't take the whole screen 回答1: I do not use

push a new tableViewController in a uipopovercontroller causes the popover to be resized

这一生的挚爱 提交于 2019-12-06 13:25:30
I found this thread, but it still doesn't fix my problem. UIPopoverController automatically resizing to max height on pushViewController I have a UIPopoverController that pushes a navigationcontroller. When I present this popover, I set the contentSizeForPopover to 340,340. That works fine. In the popover, I have a button, that pushes a new UITableViewController into the already existing UIPopoverController (code below for the tableViewController). UITableViewController *contentView = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; contentView.tableView.delegate = self;

setPopoverContentSize not working

喜你入骨 提交于 2019-12-06 12:32:37
I have a UIPopoverController in a view, and the following method to update its CGSize : -(void)updatePop:(CGSize)newSize { NSLog(@"New Size: %@", NSStringFromCGSize(newSize)); [popoverSearch setPopoverContentSize:newSize animated:YES]; NSLog(@"popoverContentSize: %@", NSStringFromCGSize(popoverSearch.popoverContentSize)); } When the method runs, the console shows the following: New Size: {320, 640} popoverContentSize: {320, 409} Does anyone have idea why it's happening? It happens specially in landscape... Chuck H I was having a similar problem in that I was unable to change the size of a

popoverControllerDidDismissPopover method is not called

二次信任 提交于 2019-12-06 10:21:11
In my application I have a presentViewController , and inside it I have a button that opens a popover. In this popover I have a barButtonItem to save de data of this popover. I would like that when the user taps outside of the popover, the data could be saved too. I've tried to use the popoverControllerDidDismissPopover method in the presentViewController view. I have the delegate but when I tap outside of the popover this method is not called. What can I do? Thanks!! Add this line of code while adding popOver: popover.delegate = self; Also register popOverDelegate in .h file where u present

UIPopoverController 使用总结

我怕爱的太早我们不能终老 提交于 2019-12-06 09:26:32
先看他的继承关系,UIPopoverController是直接继承自NSObject,它和UIViewController没有关系.那它是怎么实现弹出在所有View之上的,我猜测是利用了keywindow,把这个View加在keywindow里面,我做了个试验,一般我们会在AppDelegate的didFinishLaunchingWithOptions中来初始化我们的window,把应用的第一个viewcontroller加到window中去,并在最后调用window的makekeyandvisible方法。于是我尝试在window实例调用makekeyandvisible方法的之前弹出一个UIPopoverController,于是得到了下面的错误: ***Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:'-[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:]: Popovers cannot be presented from a view which does not have a window.'