我想在我的iPad应用程序的弹窗视图中显示自定义的tableview。这工作正常。我想在工具栏上添加按钮(在tableview的底部)。工具栏显示为空。任何建议?UIToolbar项目不在弹出窗口中显示
请注意,当用户触摸主视图控制器中的按钮时,会触发以下代码。
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.customTableViewController];
UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"item 1" style:UIBarButtonItemStylePlain target:nil action:nil];
UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithTitle:@"item 2" style:UIBarButtonItemStylePlain target:nil action:nil];
[navigationController setToolbarHidden:NO];
navigationController.navigationBar.topItem.title = @"Some Title";
NSArray *array = [[NSArray alloc] initWithObjects:item1, item2, nil];
[navigationController setToolbarItems:array];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:navigationController];
self.popoverController = popover;
popoverController.delegate = self;
[popoverController presentPopoverFromRect:[sender bounds] inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
我打一个类似的问题,实现代码如下所示罚款的酥料饼的,但下面的按钮是不可见的。如果我想出点什么,我会告诉你。 – 2012-05-23 22:04:39
我希望有人解决这个问题。 – Hamdi 2012-05-24 00:53:59