0

圣诞节快乐。

我有一个包含 uitableview 的视图。IAM使用Wepopover在选择其中一个桌面时显示出版信息。但是我的问题是在选择某些单元格时,弹出框的一部分显示在视图之外并且不可见。内容大小设置正确,原点也正确。

为了添加弹出框,我这样做,其中框架是 uitableview 单元格的框架

detailedInfoView=[[ScheduleDetailedInformation alloc] initWithNibName:@"ScheduleDetailedInformation" bundle:nil];

        detailedInfoView.contentSizeForViewInPopover = detailedInfoView.view.frame.size;    

        navPopover = [[WEPopoverController alloc] initWithContentViewController:detailedInfoView];

        [navPopover presentPopoverFromRect:frame
                                    inView:self.tableview
                  permittedArrowDirections:UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown|UIPopoverArrowDirectionLeft|UIPopoverArrowDirectionAny
                                  animated:YES];

谁能告诉我我忘记了什么或者解决方法?

谢谢

4

1 回答 1

0

不幸的是,没有人给我一个黄金答案。但是我自己解决了这个问题。在添加弹出视图之前,我将其添加到 uitableview 中,但这首先产生了问题。相反,我将它添加到父视图中,但是这产生了一些定位错误,我使用以下代码行解决了这些错误 - 它将 uitableviewcell 的位置转换为父视图中的位置。

CGPoint tmp= [[tableView cellForRowAtIndexPath:indexPath].superview convertPoint:[tableView cellForRowAtIndexPath:indexPath].frame.origin toView:nil];

CGRect frame = CGRectMake(tmp.x, tmp.y-(CGRectCell.size.height/2), CGRectCell.size.width, CGRectCell.size.height);

希望这可以帮助别人:)

于 2011-12-27T13:44:18.923 回答