如何将UIPopoverController的箭头放置在UITableView的选定单元格上
发布于 2010-04-07 22:15:46
您可以定义希望弹出窗口指向的CGRect。
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];发布于 2010-05-01 13:04:52
尝试使用以下方法获取所选行的CGRect。
CGRect selectedRect = self.tableView rectForRowAtIndexPath:indexPath;
然后在呈现UIPopoverController时使用rect:
presentPopoverFromRect: permittedArrowDirections:UIPopoverArrowDirectionLeft myPopover .............inView:self.view presentPopoverFromRect:是;
发布于 2010-04-07 18:13:18
我相信箭头是由弹出视图本身自动放置的。因此,无论您将弹出框设置为什么,它都将绘制其箭头顶部和中心。
https://stackoverflow.com/questions/2590607
复制相似问题