ios popover视图中的uitableview

时间:2013-02-11 05:13:18

标签: iphone ios6 uitableview uipopovercontroller

任何人都可以给我参考或教程如何在uipopopover视图中包含uitabelview带有详细视图控制器的Controlelr,请做好,请提前致谢

更新

 - (IBAction) useCameraRoll: (id)sender
 {

if([self.popoverController isPopoverVisible])
{
    [self.popoverController dismissPopoverAnimated:YES];
    return;
 }
 //build our custom popover view
 UIViewController* popoverContent = [[UIViewController alloc]init];
 UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 140, 102)];
 popoverView.backgroundColor = [UIColor blackColor];

 UITableView *tblViewMenu = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 140, 102)];
 tblViewMenu.delegate = self;
 tblViewMenu.dataSource = self;
 tblViewMenu.rowHeight = 32;
 [popoverView addSubview:tblViewMenu];
 popoverContent.view = popoverView;
 popoverContent.contentSizeForViewInPopover = CGSizeMake(140, 102);
 self.popoverController = [[UIPopoverController alloc]
                          initWithContentViewController:popoverContent];
 //present the popover view non-modal with a
 //refrence to the toolbar button which was pressed
 [self.popoverController  presentPopoverFromRect:CGRectMake(0, 0, 133, 29)
                                         inView:gal   permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
 }

1 个答案:

答案 0 :(得分:1)

请在发布此处之前尝试Google查询您的查询。 你可以在这里找到一个教程 http://iphoneapp-dev.blogspot.in/2010/11/how-to-insert-uitableview-in.html