2012-09-17 43 views
0

我喜歡將標題和按鈕添加到UIPopoverController。隨着我當前的代碼我喜歡將標題和按鈕添加到UIPopoverController

- (IBAction)listOfDocumnetsInSections:(id)sender { 

UIViewController *listViewController = [[UIViewController alloc] init]; 
self.lsitOfDocument = [[UITableView alloc] initWithFrame:CGRectMake(0, 10, 300, [self countRecordsInEntity] * 43) style:UITableViewStylePlain]; 
self.lsitOfDocument.dataSource = self; 
self.lsitOfDocument.delegate = self; 

[listViewController.view addSubview:self.lsitOfDocument]; 
self.listOfSectionsPopOver = [[UIPopoverController alloc] initWithContentViewController:listViewController]; 

[self.listOfSectionsPopOver setPopoverContentSize:CGSizeMake(300, [self countRecordsInEntity] * 43)]; 
[self.listOfSectionsPopOver presentPopoverFromRect:CGRectMake(700, 35, 10, 10) 
              inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny 
              animated:YES];} 

它看起來像

enter image description here

但我想改變像下面

enter image description here

任何建議UI?

回答

1

一對夫婦的選擇:

  1. 添加一個UIToolbar到您的視圖的頂部
  2. 爲您的UITableView節頭包含UIToolbar

的UIToolbar將包含標籤和按鈕