3
在我的应用程序中,我有一个UITableView
,它的一个单元格中有一个UIButton
。此按钮有一个动作:UITableViewCell中的一个按钮的UIPopoverPresentationController
- (IBAction)showPopover:(UIButton *)sender
{
ChoseOptionsViewController *contentController = [[ChoseOptionsViewController alloc] init];
contentController.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *copvc = contentController.popoverPresentationController;
copvc.permittedArrowDirections = UIPopoverArrowDirectionAny;
copvc.sourceView = self.view;
copvc.sourceRect = sender.bounds;
contentController.preferredContentSize = CGSizeMake(200, 200);
[self presentViewController:contentController animated:YES completion:nil];
}
的问题是,sender.bounds
返回任何内容,因此酥料饼中的self.view
左上角所示,不受按键的一侧。 在此先感谢。
非常感谢。我认为我已经尝试了一切,但看起来像我错过了这一个。 – piligreem 2014-10-19 15:52:49
在iPad上出色的作品 – 2017-08-16 11:20:45