本文整理汇总了C#中UIPopoverController.Dismiss方法的典型用法代码示例。如果您正苦于以下问题:C# UIPopoverController.Dismiss方法的具体用法?C# UIPopoverController.Dismiss怎么用?C# UIPopoverController.Dismiss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIPopoverController
的用法示例。
在下文中一共展示了UIPopoverController.Dismiss方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showInfo
partial void showInfo (NSObject sender)
{
if (UserInterfaceIdiomIsPhone) {
var controller = new FlipsideViewController () {
ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal,
};
controller.Done += delegate {
this.DismissModalViewControllerAnimated (true);
};
this.PresentModalViewController (controller, true);
} else {
if (flipsidePopoverController == null) {
var controller = new FlipsideViewController ();
flipsidePopoverController = new UIPopoverController (controller);
controller.Done += delegate {
flipsidePopoverController.Dismiss (true);
};
}
if (flipsidePopoverController.PopoverVisible) {
flipsidePopoverController.Dismiss (true);
} else {
flipsidePopoverController.PresentFromBarButtonItem ((UIBarButtonItem)sender, UIPopoverArrowDirection.Any, true);
}
}
}
开发者ID:holisticware-admin,项目名称:HolisticWare.TheGeekGathering.Workshop,代码行数:28,代码来源:MainViewController.cs
示例2: DisplaySettingsOptions
void DisplaySettingsOptions()
{
if (UserInterfaceIdiomIsPhone) {
aboutViewController = new AboutViewController (this);
aboutViewController.Done += (button, even) => {
DismissViewController (true, null);
};
PresentViewController (aboutViewController, true, null);
} else {
if (aboutViewController == null) {
var controller = new AboutViewController (this);
aboutPopoverController = new UIPopoverController (controller);
aboutPopoverController.PopoverContentSize = new SizeF (320f, 420f);
controller.Done += delegate {
aboutPopoverController.Dismiss (true);
};
}
if (aboutPopoverController.PopoverVisible) {
aboutPopoverController.Dismiss (true);
} else {
aboutPopoverController.PresentFromRect (settingsButton.Frame, View, UIPopoverArrowDirection.Any, true);
}
}
}
示例3: DisplayMusicOptions
void DisplayMusicOptions()
{
if (UserInterfaceIdiomIsPhone) {
flipsideViewController = new FlipsideViewController (this);
flipsideViewController.Done += (button, even) => {
DismissViewController (true, null);
};
PresentViewController (flipsideViewController, true, null);
} else {
if (flipsidePopoverController == null) {
var controller = new FlipsideViewController (this);
flipsidePopoverController = new UIPopoverController (controller);
flipsidePopoverController.PopoverContentSize = new SizeF (320f, 460f);
controller.Done += delegate {
flipsidePopoverController.Dismiss (true);
};
}
if (flipsidePopoverController.PopoverVisible) {
flipsidePopoverController.Dismiss (true);
} else {
flipsidePopoverController.PresentFromRect (musicButton.Frame, View, UIPopoverArrowDirection.Any, true);
}
}
}
示例4: ShowImagePickerView
private void ShowImagePickerView()
{
UIApplication.SharedApplication.InvokeOnMainThread (delegate {
UIImagePickerController imagePickerController = new UIImagePickerController();
imagePickerController.FinishedPickingImage += HandleImagePickerControllerFinishedPickingImage;
imagePickerController.FinishedPickingMedia += HandleImagePickerControllerFinishedPickingMedia;
imagePickerController.Canceled += HandleImagePickerControllerCanceled;
if(IPhoneUtils.GetInstance().IsIPad()) {
try {
// in iPad, the UIImagePickerController should be presented inside a UIPopoverController, otherwise and exception is raised
popover = new UIPopoverController(imagePickerController);
UIView view = IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().View;
//RectangleF frame = new RectangleF(new PointF(0,0),new SizeF(view.Frame.Size.Width, view.Frame.Size.Height));
RectangleF frame = new RectangleF(new PointF(0,0),new SizeF(0,0));
popover.PresentFromRect(frame, view, UIPopoverArrowDirection.Up, true);
}catch(Exception ex) {
INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance ().GetService ("notify");
if (notificationService != null) {
notificationService.StartNotifyAlert ("Media Alert", "Unable to reach Photo Library", "OK");
}
if(popover != null && popover.PopoverVisible) {
popover.Dismiss(true);
popover.Dispose();
}
}
} else {
IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().PresentModalViewController (imagePickerController, true);
}
});
}
示例5: WillPresentViewController
public override void WillPresentViewController(UISplitViewController svc, UIPopoverController pc, UIViewController aViewController)
{
if (pc != null)
pc.Dismiss(true);
}
示例6: showImageAtIndexPath
public void showImageAtIndexPath(NSObject sender, HomepwnerItemCell cell)
{
NSIndexPath indexPath = TableView.IndexPathForCell(cell);
Console.WriteLine("Going to show the image for {0}", indexPath);
// Get the item for the index path
BNRItem i = BNRItemStore.allItems[indexPath.Row];
string imageKey = i.imageKey;
// If there is no image, we don't need to do anything
if (imageKey == null || imageKey == "")
return;
UIImage img = BNRImageStore.imageForKey(imageKey);
// Create a new ImageViewController and set its image
ImageViewController ivc = new ImageViewController();
ivc.Image = img;
ivc.PopoverSize = new CGSize(600, 600);
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
// Make a rectangle that the frame of the button relative to our table view
UIButton btn = sender as UIButton;
CGRect rect = View.ConvertRectFromView(btn.Bounds, btn);
// Present a 600 x 600 popover from the rect
imagePopover = new UIPopoverController(ivc);
imagePopover.PopoverContentSize = ivc.PopoverSize;
imagePopover.DidDismiss += (object pSender, EventArgs e) => {
imagePopover.Dismiss(true);
imagePopover = null;
};
imagePopover.PresentFromRect(rect, View, UIPopoverArrowDirection.Any, true);
}
else {
this.NavigationController.PushViewController(ivc, true);
}
}
示例7: InvoiceSideBar
public InvoiceSideBar()
{
this.Layer.BorderColor = UIColor.Black.ColorWithAlpha (.25f).CGColor;
this.Layer.BorderWidth = .5f;
BackgroundColor = Theme.Current.SideBarBackGroundColor;//UIColor.DarkGray;
AddSubview (tableView = new UITableView (RectangleF.Empty, UITableViewStyle.Grouped) {
BackgroundColor = UIColor.Clear,
Source = source = new CellTableViewSource {
(customer = new CustomerPickerCell {
Tapped = async () => {
CustomerSearchViewController customerSearch;
popover = new UIPopoverController (new UINavigationController (customerSearch = new CustomerSearchViewController {
CustomerPicked = (c) => {
Invoice.Customer = c;
popover.Dismiss (true);
popover.Dispose ();
if(Invoice.Customer.IsNew)
{
//
NewCustomerInfoViewController newCust;
newCustPopover = new UIPopoverController(new UINavigationController(newCust = new NewCustomerInfoViewController()));
newCust.Popover = newCustPopover;
newCust.HowTheyHeard = (i) => {
invoice.AddItem(i);
newCustPopover.Dismiss(true);
newCustPopover.Dispose();
};
newCustPopover.PresentFromRect (customer.Frame, tableView, UIPopoverArrowDirection.Right, true);
//
}
}
}) {
NavigationBar = {
BarStyle = UIBarStyle.BlackTranslucent,
}
});
customerSearch.Popover = popover;
popover.PresentFromRect (customer.Frame, tableView, UIPopoverArrowDirection.Right, true);
}
}),
(subtotal = new SubTotalCell ()),
(discount = new DiscountCell {
AddDiscount = () =>{
}
}),
(total = new TotalCell ()),
new PayCell {
Frame = new RectangleF(0,0,320,60),
Text = "Checkout",
TintColor = UIColor.White,
Tapped = () => {
Checkout ();
}
}, (lastPostedChange = new LastPostedCell () {
}),
(printLastInvoice = new PrintLastInvoiceCell{
Text = "Print last invoice",
Tapped = ()=>{
WebService.Main.PrintInvoice(Settings.Shared.LastPostedInvoice);
}
}),
},
ScrollEnabled = false,
TableHeaderView = new UIView (new RectangleF (0, 0, 0, 64)),
});
Binding.Create (() => lastPostedChange.DetailTextLabel.Text == Settings.Shared.LastPostedChangeString);
customerInfo = new UITableViewCell[] {
(email = new MiniCell {
TextLabel = {
Text = "Email"
},
Tapped = ()=>{
showEditor(email);
},
}),
(phoneNumber = new MiniCell {
TextLabel = {
Text = "Phone"
},
Tapped = ()=>{
showEditor(phoneNumber);
},
}),
(onAccount = new MiniCell {
TextLabel = {
Text = "On Account"
},
Tapped = ()=>{
showEditor(onAccount);
},
}),
};
}