【发布时间】:2012-01-28 13:04:47
【问题描述】:
我有一个弹出框,它是从另一个弹出框呈现的。他们都有tableViews。第一行的第二个弹出框很好,箭头指向单元格的中间。但是其他的都指向单元格的顶部,而箭头是在popover的顶部,而不是在中间……
这就是我构建弹出框的方式
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
self.editController = [[TitleViewController alloc] init];
[self.editController setSizeWithWidth:self.view.bounds.size.width AndHeight:140.0];
self.editController.directoryString = [directoryPath stringByAppendingPathComponent:[self.tableView cellForRowAtIndexPath:indexPath].textLabel.text];
self.editPopoverController = [[UIPopoverController alloc] initWithContentViewController:self.editController];
CGRect aFrame = [self.tableView rectForRowAtIndexPath:indexPath];
[self.editPopoverController presentPopoverFromRect:aFrame inView:self.tableView permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
}
编辑
如果我将箭头方向更改为Any,它看起来像这样。
再次返回ArrowDirection = Left
如果我进行了建议的更改(请注意aFrame.size.height * 2 并且没有被二除),箭头指向单元格的中间,但仍然笨拙地定位在新的弹出框中(不是在中间)
【问题讨论】:
标签: ios ipad uitableview positioning uipopovercontroller