objective-c - iOS-从导航工具栏按钮通过TableView显示UIPopoverController

标签 objective-c ios xcode ipad

当用户点击我的NavigationController提供的下部工具栏中的按钮时,我想在iPad应用程序中显示UIPopoverController。是否有关于如何执行此操作的教程?我发现的只是2010年的古代教程。

先感谢您。

最佳答案

-(IBAction)ButtunClickMethod:(id)sender{
 //create the table view controller from nib
        self.tblLisView = [[[tableListVC alloc] 
                                        initWithNibName:@"tableListVC" 
                                        bundle:[NSBundle mainBundle]] autorelease];

        //set popover content size
        tblLisView.contentSizeForViewInPopover = CGSizeMake(170, 170);

        //create a popover controller
        self.popoverController = [[[UIPopoverController alloc]
                                   initWithContentViewController:tblLisView] autorelease];


        //present the popover view non-modal with a
        //refrence to the button pressed within the current view
        [self.popoverController presentPopoverFromRect:popoverButton.frame
                                                inView:self.view
                              permittedArrowDirections:UIPopoverArrowDirectionDown
                                              animated:YES];
}

关于objective-c - iOS-从导航工具栏按钮通过TableView显示UIPopoverController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12615685/

相关文章:

ios - 如何知道 UICollectionViewCell 是否即将被取消队列?

objective-c - 指针指向什么?

ios - 我可以在 Xcode 中更改背景颜色时保持 UI 元素可访问吗?

iphone - 如何打印单元格标签中的数组值?

ios - NSURLConnection 在两次后崩溃

ios - 在类中初始化协议(protocol)

objective-c - KVO for one-to-many but NSNull object passed into observeValueForKeyPath

ios - 单个产品的消耗品应用内购买?

ios - 使用手势从底部滑动 View Controller

ios - 如何进行 Cocoapods 安装?