Tag: uipopovercontroller

UIPopoverControllerclosures“点击” – 如何检测此事件?

我在导航栏上使用UIPopover。 我有几个UIBarButtonItems和popover从其中之一延伸。 当popOver激活时,我将button的样式改为UIBarButtonItemStyleDone 。 然而,popOver是通过点击UIPopoverController按预期解雇,但在此之后,我想要将样式更改回UIBarButtonItemStyleBordered 。 有没有一种方法可以检测到UIPopOverController是否closures? 因此,搭载这个是为了我自己的需要?

如何在iOS7的UIPopoverController中禁用较暗的透明效果?

我使用UIPopoverController在iPad iOS7中popup视图,如下所示: if (!self.popover) { UIViewController *popupVC = [[UIViewController alloc] init]; [popupVC.view addSubview:thePopupView]; popupVC.preferredContentSize = CGSizeMake(240, 140); self.popover = [[UIPopoverController alloc] initWithContentViewController:popupVC]; self.popover.delegate = self; } [self.popover presentPopoverFromBarButtonItem:barButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 但是当popover激活时, 屏幕会变暗,而这个效果不会影响iOS6中的其他视图。 如何克服这个问题? 谢谢!

使用UIPopoverController时出错

在我目前的应用程序中,当我点击一个工具栏button时,我正在尝试创build一个菜单屏幕apear。 我发现最好的方法是使用UIPopoverController来显示我创build的自定义视图。 但是,有关我目前的代码是有缺陷的。 当我运行我的应用程序,并按下button,我得到一个错误,说它是达到dealoc,而popup仍然可见。 即使看了几个类似问题的例子,我也无法想象如何解决这个问题。 这是我的代码: -(IBAction)newMenu:(id)sender{ newTaskWindow *newTaskWin = [[newTaskWindow alloc]init]; UIView *test = [[UIView alloc]init]; test = newTaskWin.view; UIPopoverController *taskPop = [[UIPopoverController alloc]initWithContentViewController:newTaskWin]; [taskPop setDelegate:self]; [taskPop presentPopoverFromBarButtonItem:newTaskButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; [taskPop setPopoverContentSize:CGSizeMake(400, 500)]; 有任何想法吗? 提前致谢 } 这是它产生的错误: *** Terminating app due to uncaught exception 'NSGenericException', reason: '- [UIPopoverController dealloc] reached while popover is still […]

弱链接UIPopoverBackgroundView

我有一个项目,必须部署到4.0,但有一些function只有5.0,如用户界面定制。 我想我的UIPopoverBackgroundView子类弱连接,但我总是遇到以下错误启动时4.X设备 dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverBackgroundView 我无法使用NS_CLASS_AVAILABLEmacros,因为popup窗口的自定义背景是UIPopoverBackgroundView类的子类,所以必须在.h中声明。 我如何弱链接UIKit的一部分? 或者还有别的办法解决这个问题吗? 谢谢大家

popoverControllerDidDismissPopover方法不被调用

在我的应用程序中,我有一个presentViewController ,里面有一个打开popup窗口的button。 在这个popover中,我有一个barButtonItem来保存这个popover的数据。 我希望当用户点击popover之外时,数据也可以被保存。 我试图在presentViewController视图中使用popoverControllerDidDismissPopover方法。 我有委托,但是当我在popover之外点击时,这个方法不会被调用。 我能做什么? 谢谢!!

UIPopoverController在iPad中的位置

我点击了button,打开了一个popup窗口。 我想设置该视图的x和y位置。 我尝试了很多,但无法正确设置。 这是我的代码: -(IBAction)product2_click_h2 { //build our custom popover view UIViewController* popoverContent2 = [[UIViewController alloc] init]; UIView* popoverView2 = [[UIView alloc]initWithFrame:CGRectMake(100,100,200,200)]; popoverView2.backgroundColor = [UIColor greenColor]; UITextView *prod2_info = [[UITextView alloc]initWithFrame:CGRectMake(5,5,390,290)]; [prod2_info setFont:[UIFont fontWithName:@"Arial" size:15]]; [popoverView2 addSubview:prod2_info]; [prod2_info setEditable:NO]; prod2_info.text = @"\n" " Higher Mileage Motor Oil :\n " " ————————————–\n\n" " –> MaxLife NextGen […]

与UIPopoverController奇怪的错误

我正尝试使用UIImagePickerController从iPhone / iPad上的用户照片中抓取照片。 这个代码适用于iPhone,但是当我在iPad上运行它时,debugging器给我提示消息“由于未捕获的exception'NSGenericException',原因:' – [UIPopoverController dealloc] popover仍然可见时到达”。 我对Objective-C非常陌生,所以我不确定是什么原因导致的,我不会释放任何东西,而且我已经打开了ARC。 这是我的代码:ViewController.m #import "PhotoViewController.h" @implementation PhotoViewController @synthesize grabButton; @synthesize image; @synthesize imgPicker; – (IBAction)grabImage { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:imgPicker]; [popover presentPopoverFromRect:self.image.bounds inView:self.image permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } else { [self presentModalViewController:imgPicker animated:YES]; } } – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary […]

移除UIPopoverPresentationController背后的调光视图

我试图删除使用UIPopoverPresentationController呈现popover背后的调光视图。 我已经实现了一个自定义的UIPopoverBackgroundView,但似乎没有办法摆脱这个调光视图。 我已经使用视图层次结构检查器将调暗视图跟踪到了“_UIMirrorNinePatchView”,但是除了在UIWindow的子视图中抓取并从其超级视图中手动删除此视图之外,没有什么好的办法。 这种方法是有缺陷的,因为它在调光视图被移除之前暂时闪烁。 有什么build议么?

MapKit取消selectAnnotation和Popover不会animation

我有一些自定义注释,当在标注附件控件上按下时,popup窗口显示更多信息(如从苹果的地图应用程序中)。 除了不animation,即使animation设置为YES,每件事情都是有效的。 码: – (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { [mapView deselectAnnotation:view.annotation animated:YES]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; _basePopupViewController = [storyboard instantiateViewControllerWithIdentifier:@"BasePopupViewController"]; _popover = [[UIPopoverController alloc] initWithContentViewController:_basePopupViewController]; [_popover presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }

自定义PopOver模式边框

我试图实现像这样的popover: 我花了相当多的时间试图定制UIPopoverController和UIPopoverBackgroundView 。 据我所知,我的任务是不可能与公共API的popup。 有可能的: 要使用固定的angular落和可拉伸的中心的小图像,在这种情况下,我会在侧面拉长条纹。 而且我会在箭头下面有图像。 用条纹填充边框,但在这种情况下,我没有圆angular。 我内心也有烦人的内心阴影: backgroundImageView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@“airmail_pattern”]]; 有没有其他的方式来重用标准的弹窗或我只需要使用UIViewController来实现该行为? 干杯。