public override void LoadView() { base.LoadView(); this.View.BackgroundColor = UIColor.White; this.NavigationItem.Title = "Popover Sample"; this.TableView.Source = new TableViewSource(this); this.NavigationController.NavigationBar.Hidden = false; _ButtonItem = new UIBarButtonItem("Info", UIBarButtonItemStyle.Plain, (o, e) => { Popover.PresentFromRect(this.NavigationController.NavigationBar.Frame, this.NavigationController.NavigationBar, UIPopoverArrowDirection.Any, true); }); this.NavigationItem.SetRightBarButtonItem(_ButtonItem, true); // Popover is a singleton we start by "initializing" it Popover.Initialize(); Popover.ShouldDismiss = true; // This is how we get notified that the popover was closed Popover.PopoverClosed += DidDismissPopover; var puppyView = new UIImageView(UIImage.FromFile("Images/smile.png")) { Frame = new RectangleF(0, 0, 367, 367), }; Popover.ContentViewController = new UIViewController() { View = puppyView, ContentSizeForViewInPopover = new SizeF(367, 367), }; }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { Popover.PresentFromRect(tableView.RectForRowAtIndexPath(indexPath), tableView, UIPopoverArrowDirection.Any, true); }