首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ipad UIPopoverController

ipad UIPopoverController
EN

Stack Overflow用户
提问于 2010-04-07 15:16:54
回答 3查看 4.1K关注 0票数 0

如何将UIPopoverController的箭头放置在UITableView的选定单元格上

EN

回答 3

Stack Overflow用户

发布于 2010-04-07 22:15:46

您可以定义希望弹出窗口指向的CGRect。

代码语言:javascript
复制
CGPoint point = ...; // where they tapped on screen, taken from UIEvent, if you like
CGSize size = ...; // give a size range, maybe the size of your table cell
[popover presentPopoverFromRect:CGRectMake(point.x, point.y, size.width, size.height) 
inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
票数 5
EN

Stack Overflow用户

发布于 2010-05-01 13:04:52

尝试使用以下方法获取所选行的CGRect。

CGRect selectedRect = self.tableView rectForRowAtIndexPath:indexPath;

然后在呈现UIPopoverController时使用rect:

presentPopoverFromRect: permittedArrowDirections:UIPopoverArrowDirectionLeft myPopover .............inView:self.view presentPopoverFromRect:是;

票数 3
EN

Stack Overflow用户

发布于 2010-04-07 18:13:18

我相信箭头是由弹出视图本身自动放置的。因此,无论您将弹出框设置为什么,它都将绘制其箭头顶部和中心。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2590607

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档