本文整理汇总了C#中UIWindow类的典型用法代码示例。如果您正苦于以下问题:C# UIWindow类的具体用法?C# UIWindow怎么用?C# UIWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIWindow类属于命名空间,在下文中一共展示了UIWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
MainWindow = new UIWindow(UIScreen.MainScreen.Bounds);
var currentHomeUiViewController = new SplashViewController();
RootNavigationController = new UINavigationController(currentHomeUiViewController);
MainWindow.RootViewController = RootNavigationController;
var titleTextAttributes = new UITextAttributes();
titleTextAttributes.TextColor = UIColor.FromRGB(25, 83, 135);
titleTextAttributes.TextShadowColor = UIColor.Clear;
titleTextAttributes.Font = UIFont.SystemFontOfSize(16);
// if (IsIOS5OrGreater)
// {
// UINavigationBar.Appearance.SetTitleTextAttributes(titleTextAttributes);
// UINavigationBar.Appearance.SetBackgroundImage(UIImage.FromBundle("/Images/top_bar_bg"), UIBarMetrics.Default);
// }
//
MainWindow.MakeKeyAndVisible();
return true;
}
示例2: OnSetupWindow
protected virtual void OnSetupWindow()
{
UIWindow window = new UIWindow(UIScreen.MainScreen.Bounds);
window.RootViewController = NavigationController;
window.MakeKeyAndVisible();
var result = _navigationProvider.NavigateAsync(MainPageViewModelType);
}
示例3: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
Forms.Init ();
// http://forums.xamarin.com/discussion/21148/calabash-and-xamarin-forms-what-am-i-missing
Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {
// http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
if (null != e.View.StyleId) {
e.NativeView.AccessibilityIdentifier = e.View.StyleId;
Console.WriteLine("Set AccessibilityIdentifier: " + e.View.StyleId);
}
};
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = App.GetMainPage ().CreateViewController ();
window.MakeKeyAndVisible ();
#if DEBUG
// requires Xamarin Test Cloud Agent component
Xamarin.Calabash.Start();
#endif
return true;
}
示例4: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create our window
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.MakeKeyAndVisible ();
// are we running an iPhone or an iPad?
DetermineCurrentDevice ();
// instantiate our main navigatin controller and add it's view to the window
mainNavController = new UINavigationController ();
switch (CurrentDevice)
{
case DeviceType.iPhone:
iPhoneHome = new HandlingRotation.Screens.iPhone.Home.HomeScreen ();
mainNavController.PushViewController (iPhoneHome, false);
break;
case DeviceType.iPad:
iPadHome = new HandlingRotation.Screens.iPad.Home.HomeScreenPad ();
mainNavController.PushViewController (iPadHome, false);
break;
}
window.RootViewController = mainNavController;
return true;
}
示例5: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackTranslucent;
viewController = new FlyOutNavigationController ();
viewController.NavigationRoot = new RootElement ("")
{
new Section ("Section 1"){
new StringElement ("View 1"),
new ImageStringElement("View 2",UIImage.FromFile("jhill.jpeg")),
new StringElement ("View 3"),
},
new Section ("Section 2"){
new StringElement ("View 1"),
new StringElement ("View 2"),
}
};
viewController.ViewControllers = new UIViewController[]{
new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 1")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 2")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 3")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 1")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 2")}}))
};
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
return true;
}
示例6: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
//
// ENTER YOUR LICENSE INFO HERE
//
PXEngine.LicenseKeyForUser("SERIAL NUMBER", "USER NAME");
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = new MyViewController();
// make the window visible
window.MakeKeyAndVisible ();
PXEngine shared = PXEngine.SharedInstance();
// Print the version an build date
Console.WriteLine("Pixate Engine v{0} {1}", shared.Version, shared.BuildDate);
// Print the location of the current application-level stylesheet
Console.WriteLine("CSS File location: {0}", PXStylesheet.CurrentApplicationStylesheet().FilePath);
// Monitor for changes in the stylesheet and update styles live
PXStylesheet.CurrentApplicationStylesheet().MonitorChanges = true;
return true;
}
示例7: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
viewController = new UINavigationController ();
viewController.PushViewController(new MainScreenGroup(), true);
viewController.NavigationBar.Opaque = true;
window.MakeKeyAndVisible ();
#if LITE
AdManager.LoadBanner();
#endif
// On iOS5 we use the new window.RootViewController, on older versions, we add the subview
if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
window.RootViewController = viewController;
else
window.AddSubview (viewController.View);
#if LITE
Apprater = new Appirater(527002436);
#else
Apprater = new Appirater(526844540);
#endif
Apprater.AppLaunched();
return true;
}
示例8: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
var root = new RootElement("MBProgressHUD")
{
new Section ("Samples")
{
new StringElement ("Simple indeterminate progress", ShowSimple),
new StringElement ("With label", ShowWithLabel),
new StringElement ("With details label", ShowWithDetailsLabel),
new StringElement ("Determinate mode", ShowWithLabelDeterminate),
new StringElement ("Annular determinate mode", ShowWIthLabelAnnularDeterminate),
new StringElement ("Custom view", ShowWithCustomView),
new StringElement ("Mode switching", ShowWithLabelMixed),
new StringElement ("Using handlers", ShowUsingHandlers),
new StringElement ("On Window", ShowOnWindow),
new StringElement ("NSURLConnection", ShowUrl),
new StringElement ("Dim background", ShowWithGradient),
new StringElement ("Text only", ShowTextOnly),
new StringElement ("Colored", ShowWithColor),
}
};
dvcDialog = new DialogViewController(UITableViewStyle.Grouped, root, false);
navController = new UINavigationController(dvcDialog);
window.RootViewController = navController;
window.MakeKeyAndVisible ();
return true;
}
示例9: InitPanoramaSample
private void InitPanoramaSample()
{
this.window = new UIWindow(UIScreen.MainScreen.Bounds);
this.window.RootViewController = new TestPanorama();
this.window.MakeKeyAndVisible();
}
示例10: MXTouchContainer
private MXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
: base(theApp, appDelegate, window)
{
touchNavigation = new MXTouchNavigation(appDelegate, window);
ViewGroups = new List<MXTouchViewGroup>();
}
示例11: FinishedLaunching
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
// Code to start the Xamarin Test Cloud Agent
#if ENABLE_TEST_CLOUD
Xamarin.Calabash.Start();
#endif
Window = new UIWindow (UIScreen.MainScreen.Bounds);
application.StatusBarHidden = true;
application.ApplicationSupportsShakeToEdit = true;
var path = NSBundle.MainBundle.PathForResource("appdata", "json");
var json = File.ReadAllText (path);
var data = Newtonsoft.Json.JsonConvert.DeserializeObject<AppData>(json);
Window.BackgroundColor = UIColor.White;
_tabViewController = new FlashCardSetTabViewController (data);
Window.RootViewController = _tabViewController;
Window.MakeKeyAndVisible ();
return true;
}
示例12: LoginPageRenderer
public LoginPageRenderer()
{
dialog = new DialogViewController(new RootElement("Login"));
window = new UIWindow(UIScreen.MainScreen.Bounds);
window.RootViewController = new UINavigationController(dialog);
window.MakeKeyAndVisible();
if (App.IsGoogleLogin && !App.IsLoggedIn)
{
var myAuth = new GoogleAuthenticator("730990345527-h7r23gcdmdllgke4iud4di76b0bmpnbb.apps.googleusercontent.com",
"https://www.googleapis.com/auth/userinfo.email",
"https://accounts.google.com/o/oauth2/auth",
"https://www.googleapis.com/plus/v1/people/me");
UIViewController vc = myAuth.authenticator.GetUI();
myAuth.authenticator.Completed += async (object sender, AuthenticatorCompletedEventArgs eve) =>
{
//dialog.DismissViewController(true, null);
window.Hidden = true;
dialog.Dispose();
window.Dispose();
if (eve.IsAuthenticated)
{
var user = await myAuth.GetProfileInfoFromGoogle(eve.Account.Properties["access_token"].ToString());
await App.SaveUserData(user,true);
//dialog.DismissViewController(true, null);
App.IsLoggedIn = true;
App.SuccessfulLoginAction.Invoke();
}
};
dialog.PresentViewController(vc, true, null);
}
}
示例13: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
UIApplication.SharedApplication.StatusBarHidden = true;
image = new UIImageView (UIScreen.MainScreen.Bounds) {
Image = UIImage.FromFile ("Background.png")
};
text = new UITextField (new RectangleF (44, 32, 232, 31)) {
BorderStyle = UITextBorderStyle.RoundedRect,
TextColor = UIColor.Black,
BackgroundColor = UIColor.Black,
ClearButtonMode = UITextFieldViewMode.WhileEditing,
Placeholder = "Hello world",
};
text.ShouldReturn = delegate (UITextField theTextfield) {
text.ResignFirstResponder ();
label.Text = text.Text;
return true;
};
label = new UILabel (new RectangleF (20, 120, 280, 44)){
TextColor = UIColor.Gray,
BackgroundColor = UIColor.Black,
Text = text.Placeholder
};
var vc = new ViewController (this) { image, text, label };
window = new UIWindow (UIScreen.MainScreen.Bounds){ vc.View };
window.MakeKeyAndVisible ();
return true;
}
示例14: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
runner = new TouchRunner (window);
// tests can be inside the main assembly
runner.Add (Assembly.GetExecutingAssembly ());
#if false
// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
// start running the test suites as soon as the application is loaded
runner.AutoStart = true;
// crash the application (to ensure it's ended) and return to springboard
runner.TerminateAfterExecution = true;
#endif
#if false
// you can get NUnit[2-3]-style XML reports to the console or server like this
// replace `null` (default to Console.Out) to a TcpTextWriter to send data to a socket server
// replace `NUnit2XmlOutputWriter` with `NUnit3XmlOutputWriter` for NUnit3 format
runner.Writer = new NUnitOutputTextWriter (runner, null, new NUnitLite.Runner.NUnit2XmlOutputWriter ());
// the same AutoStart and TerminateAfterExecution can be used for build automation
#endif
window.RootViewController = new UINavigationController (runner.GetViewController ());
window.MakeKeyAndVisible ();
return true;
}
示例15: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Window = new UIWindow (UIScreen.MainScreen.Bounds);
Window.RootViewController = new ViewController ();
Window.MakeKeyAndVisible ();
return true;
}