删除 UIPopOver allowedArrowDirections

发布于 2024-11-16 10:22:39 字数 600 浏览 5 评论 0原文

我有一个 UIPopOverController,这是我的代码:

[myPopOver presentPopoverFromRect:CGRectMake(20,5, 325, 600) inView:self.view permittedArrowDirections:**UIPopoverArrowDirectionLeft** animated:YES];

但是我不需要方向箭头。任何人都可以告诉我该怎么做。我怎样才能去掉它的箭头?

现在 myPopOver 在一行上显示 4 个照片库图像。任何人都可以告诉我如何在 myPopOver 控制器中的一行上排列或仅显示两个图像。

当我点击任何地方时它也会关闭。我不想关闭它。是否有任何属性可以避免 uipopover 的关闭?

我用了代码

imagePopOver = [[UIPopoverController alloc] initWithContentViewController:self.plc.imagePickerController];
imagePopOver.popoverContentSize = CGSizeMake(150,300);

I have a UIPopOverController and this is my code:

[myPopOver presentPopoverFromRect:CGRectMake(20,5, 325, 600) inView:self.view permittedArrowDirections:**UIPopoverArrowDirectionLeft** animated:YES];

However I need no direction arrows.can any one tell me how can I do it. How can I remove the arrow from it?

Now myPopOver displaying 4 photolibrary images on a Row.can any one tell me how can arrange or display only two images on a row in myPopOver controller.

And also it dismissing when I click on ay place.I don't want to dismiss it.is the any property to avoid the dismiss of uipopover?

I used the code

imagePopOver = [[UIPopoverController alloc] initWithContentViewController:self.plc.imagePickerController];
imagePopOver.popoverContentSize = CGSizeMake(150,300);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

肩上的翅膀 2024-11-23 10:22:39

您可以借助以下代码从 UIPopover 中删除箭头。

[popOverController presentPopoverFromRect:CGRectMake(200, 300, 335, 332) inView:self.view permittedArrowDirections:NO animated:YES];

You can remove arrow from UIPopover with the help of below code.

[popOverController presentPopoverFromRect:CGRectMake(200, 300, 335, 332) inView:self.view permittedArrowDirections:NO animated:YES];
魄砕の薆 2024-11-23 10:22:39

迅速

let alertController = UIAlertController(title: "title", message: "message", preferredStyle: .ActionSheet)
alertController.popoverPresentationController?.permittedArrowDirections = []

in swift

let alertController = UIAlertController(title: "title", message: "message", preferredStyle: .ActionSheet)
alertController.popoverPresentationController?.permittedArrowDirections = []
眼前雾蒙蒙 2024-11-23 10:22:39

UIPopover 不能没有方向箭头。如果您只想要一个显示的视图,那么您需要制作自己的自定义 UIView 并隐藏它,或者将 alpha 设为 0 并在需要时淡入。就视图布局而言,您可以设置要显示的图像视图的框架属性来控制它们的放置位置。

You cannot have no direction arrows with a UIPopover. If you just want a view that appears than you will need to make your own custom UIView and hide it or turn the alpha to 0 and fade it in when you need it. As far as view layout goes you can set the frame property of your image views that you are showing to control where they are placed.

泪意 2024-11-23 10:22:39

我在 SWIFT 中的解决方案:

popover!.permittedArrowDirections = nil

My solution in SWIFT:

popover!.permittedArrowDirections = nil
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文