【发布时间】:2011-12-01 05:55:55
【问题描述】:
我在我的应用程序中使用 TableView,当我单击表格单元格时,我想要一个弹出视图,表格单元格中的所有内容都应该显示在弹出视图中,所以请建议我怎么做?
我下面有一些示例代码不起作用..所以建议使用代码我希望单元格中的所有内容都显示在弹出视图中。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIView *aView = [[UIView alloc] init];
UIPopoverController *popoverController = [[UIPopoverController alloc]
initWithContentViewController:aView];
popoverController.popoverContentSize = CGSizeMake(320, 416);
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[popoverController presentPopoverFromRect:cell.bounds inView:cell.contentView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
【问题讨论】:
标签: objective-c ipad uipopovercontroller