将popoverViewController添加到栏按钮
public partial class MagicViewController : UIViewController
{
UIBarButtonItem btn_Setting;
// UIPopoverController popoverController;
SettingPopoverViewController settingController;
public DashBoardViewController(){
btn_Setting = new UIBarButtonItem (
"Setting", UIBarButtonItemStyle.Plain,
(s, e) => {
Console.WriteLine ("Setting!!!");
settingController = new SettingPopoverViewController();
var popoverController = new UIPopoverController(settingController);
popoverController.PopoverContentSize = new SizeF(320,320);
popoverController.PresentFromRect (new RectangleF (0,0,320,320),View,UIPopoverArrowDirection.Up,true);
});
NavigationItem.RightBarButtonItem = btn_Setting;
}
如何在barButtonItem iOS上加载popoverview控制器
答案 0 :(得分:1)