UIpopovercontroller 使用 Arrowdirectionup 显示在错误的位置

发布于 2024-11-30 15:11:29 字数 528 浏览 3 评论 0原文

我处于一个奇怪的情况,问题是我显示了一个 UIpopovercontroller,其中包含一个日期选择器和一个完成按钮。但是当我用 arrowdirectionup 显示这个时,它默认从我用 x=0 和 y=0 测试它的地方得到 Y 方向,然后 x 正在工作,但 Y 仍然得到值,我不知道为什么它不工作。

如果将箭头方向更改为向下、向右或向左,则它会显示在右侧给定位置,例如 0,0。

datePopOver = [[UIPopoverController alloc] initWithContentViewController:datePopoverView];
[datePopOver setPopoverContentSize:CGSizeMake(307, 247)];
[datePopOver presentPopoverFromRect:CGRectMake(0, 0, 307, 247) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

I am in a strange situation the problem is that i am showing a UIpopovercontroller which contains a datepicker and a done button. But when i show this with arrowdirectionup then it get by default Y direction from some where i tested it with x=0 and y=0 then x is working but the Y is still get value i dont know why it not working.

And if change the arrowdirection to down, right or left then it displayed at the right given position like 0,0.

datePopOver = [[UIPopoverController alloc] initWithContentViewController:datePopoverView];
[datePopOver setPopoverContentSize:CGSizeMake(307, 247)];
[datePopOver presentPopoverFromRect:CGRectMake(0, 0, 307, 247) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文