草庐IT

UIPopover

全部标签

objective-c - 阻止 UIPopover 自动关闭

我想知道是否有办法阻止iPad弹出框在您触摸弹出框外的屏幕时自动消失?如果没有,是否有某种类似于“popoverDidDismiss”的方法,我可以调用它来判断弹出窗口何时被关闭? 最佳答案 是的,你可以。这是Apple文档中的内容。当由于用户在弹出窗口View外点击而关闭弹出窗口时,弹出窗口会自动通知其代理该操作。如果您提供委托(delegate),则可以使用此对象来防止弹出窗口的关闭或执行其他操作以响应关闭。popoverControllerShouldDismissPopover:委托(delegate)方法可让您控制弹出窗口

ios - 如何从同样以编程方式创建的 uibutton 以编程方式显示弹出窗口(不使用界面构建器)

我有一个在ViewController中以编程方式创建的按钮。按下按钮后,我希望它使用一种方法以编程方式创建弹出窗口。在我的ViewController中的ViewDidLoad中创建的按钮.mUIView*moreFundInfoView=[[UIViewalloc]initWithFrame:CGRectMake(0,0,540,620)];[self.viewaddSubview:moreFundInfoView];[moreFundInfoViewsetBackgroundColor:[UIColorRMBColor:@"b"]];btnContact=[UIButtonbut

ios - 如何从同样以编程方式创建的 uibutton 以编程方式显示弹出窗口(不使用界面构建器)

我有一个在ViewController中以编程方式创建的按钮。按下按钮后,我希望它使用一种方法以编程方式创建弹出窗口。在我的ViewController中的ViewDidLoad中创建的按钮.mUIView*moreFundInfoView=[[UIViewalloc]initWithFrame:CGRectMake(0,0,540,620)];[self.viewaddSubview:moreFundInfoView];[moreFundInfoViewsetBackgroundColor:[UIColorRMBColor:@"b"]];btnContact=[UIButtonbut

ios - UIPopover 中的 UIDatePicker

我在整个互联网上搜索过(也许我有点夸大其词了)关于如何将DatePicker放入UIPopover并在iPad应用程序中显示它的教程。我尝试创建一个ViewController,将日期选择器放在ViewController中,然后:self.popover=[[UIPopoverControlleralloc]initWithContentViewController:sa];(sa是我创建的ViewController的名称),但这不起作用,应用程序崩溃了。谁能帮忙? 最佳答案 试试下面的代码。它会正常工作:objective-C

ios - UIPopover 中的 UIDatePicker

我在整个互联网上搜索过(也许我有点夸大其词了)关于如何将DatePicker放入UIPopover并在iPad应用程序中显示它的教程。我尝试创建一个ViewController,将日期选择器放在ViewController中,然后:self.popover=[[UIPopoverControlleralloc]initWithContentViewController:sa];(sa是我创建的ViewController的名称),但这不起作用,应用程序崩溃了。谁能帮忙? 最佳答案 试试下面的代码。它会正常工作:objective-C

ios - UIPopover 如何使用这样的按钮制作弹出窗口?

我想知道如何使用这样的按钮创建弹出框。回答:UIActionSheet*actionSheet=[[UIActionSheetalloc]initWithTitle:nildelegate:selfcancelButtonTitle:nildestructiveButtonTitle:nilotherButtonTitles:@"TakePhoto",@"ChooseExistingPhoto",nil];[actionSheetshowFromRect:button.frameinView:button.superviewanimated:YES];委托(delegate)对象类中的

ios - UIPopover 如何使用这样的按钮制作弹出窗口?

我想知道如何使用这样的按钮创建弹出框。回答:UIActionSheet*actionSheet=[[UIActionSheetalloc]initWithTitle:nildelegate:selfcancelButtonTitle:nildestructiveButtonTitle:nilotherButtonTitles:@"TakePhoto",@"ChooseExistingPhoto",nil];[actionSheetshowFromRect:button.frameinView:button.superviewanimated:YES];委托(delegate)对象类中的

objective-c - 如何使 UIPopoverController 在旋转后保持相同的位置?

我无法在旋转后将弹出窗口保持在屏幕上的相同位置。有没有什么好的方法可以做到这一点,因为仅仅将一些框架设置为popover在旋转后效果很差。popover.frame=CGRectMake(someFrame);屏幕。 最佳答案 Apple有一个关于这个问题的问答。您可以在此处找到详细信息:TechnicalQ&AQA1694HandlingPopoverControllersDuringOrientationChanges基本上,该技术说明在您的ViewController的didRotateFromInterfaceOrienta

objective-c - 如何使 UIPopoverController 在旋转后保持相同的位置?

我无法在旋转后将弹出窗口保持在屏幕上的相同位置。有没有什么好的方法可以做到这一点,因为仅仅将一些框架设置为popover在旋转后效果很差。popover.frame=CGRectMake(someFrame);屏幕。 最佳答案 Apple有一个关于这个问题的问答。您可以在此处找到详细信息:TechnicalQ&AQA1694HandlingPopoverControllersDuringOrientationChanges基本上,该技术说明在您的ViewController的didRotateFromInterfaceOrienta

ios - ActionSheet 源 View BarButtonItem

我在导航栏中有一个栏按钮项,当按下它时,将显示一个UIAlertController,其样式为.ActionSheet。在iPhone中,它以我想要的方式出现。对于iPad我知道我需要添加//ForiPad,setthepopoverboundsvarpopOver=optionMenu.popoverPresentationControllerpopOver?.sourceView=buttonasUIViewpopOver?.sourceRect=(buttonasUIView).boundspopOver?.permittedArrowDirections=UIPopoverAr