[英]iOS - Show UIPopoverController with TableView from Navigation Toolbarbutton
當用戶點擊我的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];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.