Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Changing the iPhone Orientation from portrait to landscape mode in mono touch for iOS 7 not working

$
0
0

I am working in mono touch application,where i switch the view from portrait to landscape mode with auto rotation. For this,i have created two xib files for portrait and landscape views on iPhone. Initially loading the view in portrait mode is correct. But we could not able to load the view if change the rotation to landscape mode .

how to change the view from portrait to landscape orientation from loading xib files?

Please go through the following snippets.

In Appdelegate.cs

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
  // create a new window instance based on the screen size
  window = new UIWindow (UIScreen.MainScreen.Bounds);     
  viewController = new LoginViewControl ();           
  gonavigate = new UINavigationController (); 
  gonavigate.PushViewController (viewController, true);
  ** this.window.RootViewController = viewController;**
  window.MakeKeyAndVisible ();     
  return true;
}

In ViewController i am overriding the below methods :

public override bool ShouldAutorotate()    
 {     
 return false;     
 }      
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()     
 {  
 return UIInterfaceOrientationMask.All;         
 } 

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>