English 中文(简体)
UIPopoverController
原标题:Adding stuff to the UIPopoverController

I have made one popover. Presently that popover is blank. I need to add 6 buttons to the popover. Pressing any of the 6 buttons, the app takes the user to the respective screen. I want to add those buttons in table view style. You can consider the image attached with it (check the popup with 6 options in the left side of the iPad). I want to do it in the same way. Guide me please. Regards PC.enter image description here

最佳回答

创建观察控制器,增加一门可读的电文,以正确显示这些囚室,使其符合人口控制器的内容。

问题回答

开放Xcode Organizer > 文件和查询UIPopoverController。 在左侧巴,在底层开放的Popovers样本代码项目。

基本上,你认为,你需要创建<条码>,即:

- (void)viewDidLoad {
    ...
    /*  contentCtrl  is an instance of UIViewController 
     * such as an UITableViewController
     */
    ...
    popover = [[UIPopoverController alloc] initWithContentViewController:contentCtrl];
    popover.popoverContentSize = CGSizeMake(320, 480);
    ...
}

在某个时候,例如用户用一个顿语播放:

- (IBAction)showPopover:(id)sender {
    UIButton *button = (UIButton *)sender;
    [popover presentPopoverFromRect:button.frame 
                             inView:self.view 
           permittedArrowDirections:UIPopoverArrowDirectionAny 
                           animated:YES];
}

我建议对样本进行研究。 如果您需要<代码>可调取的部分,文件中有几十个样本(和SO中的100个问题)。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签