public string pegarOrientacao() { UIInterfaceOrientation orientation = UIApplication.SharedApplication.StatusBarOrientation; Console.WriteLine("Orientacao: " + orientation); return(orientation.ToString()); }
public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) { if (DisableRotation) { return(toInterfaceOrientation == InterfaceOrientation); } UIInterfaceOrientationMask mask = CurrentViewController.GetSupportedInterfaceOrientations(); UIInterfaceOrientation orientation = CurrentViewController.PreferredInterfaceOrientationForPresentation(); bool theReturn = CurrentViewController == null ? true : CurrentViewController.ShouldAutorotateToInterfaceOrientation(toInterfaceOrientation); if (CurrentViewController != null) { Debug.WriteLine("Should auto rotate: " + toInterfaceOrientation.ToString() + ": " + theReturn); } else { Debug.WriteLine("Should auto rotate: View is null"); } return(theReturn); }
/// DEPRECATED for iOS 6 and later, but needed for iOS 5 and earlier to support additional orientations public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) { bool shouldAutorotate = IPhoneUtils.GetInstance().ShouldAutorotate(); if (shouldAutorotate) { // Check supported orientations if (supportedOrientations != null) { bool orientationSupported = false; for (uint index = 0; index < supportedOrientations.Count; index++) { NSString mySupportedOrientation = new NSString(supportedOrientations.GetItem <NSString> (index)); if (("UIInterfaceOrientation" + toInterfaceOrientation.ToString()) == mySupportedOrientation.ToString()) { orientationSupported = true; break; } } shouldAutorotate = orientationSupported; } else { log("Supported orientations not configured. All orientations are supported by default"); } } else { log(" ** Autorotation blocked by application at runtime. "); } log("Should Autorotate to " + toInterfaceOrientation.ToString() + "? " + shouldAutorotate); if (shouldAutorotate) { this.ShowSplashScreenOnStartupTime(toInterfaceOrientation); } return(shouldAutorotate); }
public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) { if (DisableRotation) return toInterfaceOrientation == InterfaceOrientation; UIInterfaceOrientationMask mask = CurrentViewController.GetSupportedInterfaceOrientations(); UIInterfaceOrientation orientation = CurrentViewController.PreferredInterfaceOrientationForPresentation(); bool theReturn = CurrentViewController == null ? true : CurrentViewController.ShouldAutorotateToInterfaceOrientation(toInterfaceOrientation); if (CurrentViewController != null) Debug.WriteLine("Should auto rotate: " + toInterfaceOrientation.ToString() + ": " + theReturn); else Debug.WriteLine("Should auto rotate: View is null"); return theReturn; }
/// DEPRECATED for iOS 6 and later, but needed for iOS 5 and earlier to support additional orientations public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) { bool shouldAutorotate = IPhoneUtils.GetInstance ().ShouldAutorotate (); if (shouldAutorotate) { // Check supported orientations if (supportedOrientations != null) { bool orientationSupported = false; for (uint index = 0; index < supportedOrientations.Count; index++) { NSString mySupportedOrientation = new NSString (supportedOrientations.ValueAt (index)); if (("UIInterfaceOrientation" + toInterfaceOrientation.ToString ()) == mySupportedOrientation.ToString ()) { orientationSupported = true; break; } } shouldAutorotate = orientationSupported; } else { log ("Supported orientations not configured. All orientations are supported by default"); } } else { log (" ** Autorotation blocked by application at runtime. "); } log ("Should Autorotate to " + toInterfaceOrientation.ToString () + "? " + shouldAutorotate); if(shouldAutorotate) this.ShowSplashScreenOnStartupTime(toInterfaceOrientation); return shouldAutorotate; }
public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) { Console.WriteLine ("---> ShouldAutorotateToInterfaceOrientation: " + toInterfaceOrientation.ToString ()); return false; }
void OnGUI() { beginColumn(); if (GUILayout.Button("Show Inline WebView")) { // remember, iOS uses points not pixels for positioning and layout! EtceteraBinding.inlineWebViewShow(50, 10, 260, 300); EtceteraBinding.inlineWebViewSetUrl("http://google.com"); } if (GUILayout.Button("Close Inline WebView")) { EtceteraBinding.inlineWebViewClose(); } if (GUILayout.Button("Set Url of Inline WebView")) { EtceteraBinding.inlineWebViewSetUrl("http://prime31.com"); } if (GUILayout.Button("Set Frame of Inline WebView")) { // remember, iOS uses points not pixels for positioning and layout! EtceteraBinding.inlineWebViewSetFrame(10, 200, 250, 250); } // Second row endColumn(true); if (GUILayout.Button("Get Badge Count")) { Debug.Log("badge count is: " + EtceteraBinding.getBadgeCount()); } if (GUILayout.Button("Set Badge Count")) { EtceteraBinding.setBadgeCount(46); } if (GUILayout.Button("Get Orientation")) { UIInterfaceOrientation orient = EtceteraBinding.getStatusBarOrientation(); Debug.Log("status bar orientation: " + orient.ToString()); } if (GUILayout.Button("Get First 25 Contacts")) { // note that accessing contacts requires special permission. Please see note in the documentation available here: https://prime31.com/docs#iosEtc var contacts = EtceteraBinding.getContacts(0, 25); Utils.logObject(contacts); } endColumn(); // Next scene button if (bottomRightButton("Back")) { Application.LoadLevel("EtceteraTestScene"); } }
internal bool IsSupportedOrientation(UIInterfaceOrientation orientation) { return(Settings.ContainsKey("UISupportedInterfaceOrientations") && Settings["UISupportedInterfaceOrientations"].Split('|').Contains("UIInterfaceOrientation" + orientation.ToString())); }
public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration) { label.Text = toInterfaceOrientation.ToString(); }
public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation) { Console.WriteLine("Finished rotating from " + fromInterfaceOrientation.ToString()); }
public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) { Console.WriteLine ("MatterDetail ShouldAuto, returning false: " + toInterfaceOrientation.ToString ()); return false; }
void OnGUI() { beginColumn(); if (GUILayout.Button("Show Inline WebView")) { // remember, iOS uses points not pixels for positioning and layout! EtceteraBinding.inlineWebViewShow(50, 10, 260, 300); EtceteraBinding.inlineWebViewSetUrl("http://google.com"); } if (GUILayout.Button("Close Inline WebView")) { EtceteraBinding.inlineWebViewClose(); } if (GUILayout.Button("Set Url of Inline WebView")) { EtceteraBinding.inlineWebViewSetUrl("http://prime31.com"); } if (GUILayout.Button("Set Frame of Inline WebView")) { // remember, iOS uses points not pixels for positioning and layout! EtceteraBinding.inlineWebViewSetFrame(10, 200, 250, 250); } // Second row endColumn(true); if (GUILayout.Button("Get Badge Count")) { Debug.Log("badge count is: " + EtceteraBinding.getBadgeCount()); } if (GUILayout.Button("Set Badge Count")) { EtceteraBinding.setBadgeCount(46); } if (GUILayout.Button("Get Orientation")) { UIInterfaceOrientation orient = EtceteraBinding.getStatusBarOrientation(); Debug.Log("status bar orientation: " + orient.ToString()); } endColumn(); // Next scene button if (bottomRightButton("Back")) { Application.LoadLevel("EtceteraTestScene"); } }