本文整理汇总了C#中UINavigationController.PresentViewController方法的典型用法代码示例。如果您正苦于以下问题:C# UINavigationController.PresentViewController方法的具体用法?C# UINavigationController.PresentViewController怎么用?C# UINavigationController.PresentViewController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UINavigationController
的用法示例。
在下文中一共展示了UINavigationController.PresentViewController方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComposeSMS
/// <summary>
/// Composes the SM.
/// </summary>
/// <param name="controller">Controller.</param>
/// <param name="recipients">Recipients.</param>
/// <param name="message">Message.</param>
public static void ComposeSMS(UINavigationController controller, string[] recipients, string message)
{
MFMessageComposeViewController smsController = new MFMessageComposeViewController();
smsController.Recipients = recipients;
smsController.Body = message;
smsController.Finished += (sender, e) => {
smsController.DismissViewController(true, null);
};
controller.PresentViewController(smsController, true, null);
}
示例2: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
_window = new UIWindow(UIScreen.MainScreen.Bounds);
var welcomeView = new WelcomeView(UIScreen.MainScreen.ApplicationFrame);
_window.AddSubview(welcomeView);
welcomeView.Done += () => {
var rootController = new UINavigationController();
_window.RootViewController = rootController;
var gettingStarted = new GettingStartedViewController();
gettingStarted.Done += () => _locationService.GetCurrentLocation(coordinate => {
var me = new Ninja {
GroupName = gettingStarted.GroupName,
Latitude = coordinate.Latitude,
Longitude = coordinate.Longitude,
NickName = gettingStarted.Nickname
};
NinjaClient = new ServiceClient(gettingStarted) {
AuthenticationProvider = gettingStarted.AuthenticationProvider
};
NinjaClient.LocateNinjas(me, ninjasLocated => InvokeOnMainThread(() => {
rootController.DismissViewController(true, null);
var mapView = new MapViewController(coordinate, ninjasLocated);
mapView.Title = me.GroupName;
rootController.PushViewController(mapView, true);
}));
});
rootController.PresentViewController(gettingStarted, true, null);
};
_window.MakeKeyAndVisible();
return true;
}
示例3: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
Window = new UIWindow (UIScreen.MainScreen.Bounds);
ViewController = new ViewController ();
var navigationController = new UINavigationController (ViewController) {
NavigationBarHidden = true
};
GKLocalPlayer.LocalPlayer.AuthenticateHandler = (viewController, error) => {
if (error != null) {
Console.WriteLine ("Error while trying to authenticate local player: " + error.Description);
return;
}
if (GKLocalPlayer.LocalPlayer.Authenticated || (viewController == null))
return;
navigationController.PresentViewController (viewController, true, null);
};
Window.RootViewController = navigationController;
Window.MakeKeyAndVisible ();
return true;
}
示例4: PresentView
private void PresentView (UINavigationController navigationController, UIViewController view)
{
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
view.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
view.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
navigationController.PresentViewController (view, true, null);
}
else {
navigationController.PushViewController (view, true);
}
}