Change orientation of UIViewController



Share on Google+Share on Google+

Java Coder
Change orientation of UIViewController
2 Answer(s)      5 years and 10 months ago
Posted in : Travel & Tourism

Is it possible to change the UIViewController orientation dynamically?

View Answers

July 2, 2011 at 12:54 PM

To enable the interface orientation in UIView just add the given code into your interface orientation method..

UIInterfaceOrientation interfaceOrientation = self.interfaceOrientation;

typedef enum {
  UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
  UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
  UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeLeft,
  UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeRight
} UIInterfa

July 2, 2011 at 1:04 PM

iPhone Interface Orientation code

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return YES; // Return YES is the same as entering all interfaces.

-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {

    [self presentModalViewController:landscapeChartViewController animated:NO];

if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {

    [self.parentViewController dismissModalViewControllerAnimated:NO];
    // self.parentViewController seems like a call FROM the modalViewController. 
    // This should be moved to the modalViewControllers implementation


Related Tutorials/Questions & Answers:
Change orientation of UIViewController
Change orientation of UIViewController  Is it possible to change the UIViewController orientation dynamically
iphone handle orientation change
iphone handle orientation change   How can i handle the orientation change in iPhone / iPad application? Please suggest. Thank in Advance
uiviewcontroller viewwillappear
uiviewcontroller viewwillappear  When i reload uiviewcontroller, viewwillappear method not getting called. Can anyone please explain what is the proble
Rotating UIViewController
Rotating UIViewController In this example, we are going to show you.. how to rotate your UIView into both portrait or landscape orientation. Steps for Rotating UIViewController in both portrait and landscape orientation. -> Create
landscape orientation iPad
landscape orientation iPad   In my iPad application, i want to change the orientation as landscape only.. how could i be done? Currently i'm using...; } Please help. Thanks in advance!   To fix the orientation
How to dismiss UIViewController
How to dismiss UIViewController  How to dismiss UIViewcontroller in my iPhone application? Please suggest. Thanks
Call UIViewController over RootViewController
Call UIViewController over RootViewController   Hi, i have created the window based application.. but not sure how to call the UIView over RootViewController. Thanks
reload uiviewcontroller iphone
reload uiviewcontroller iphone  Can anyone tell me how to reload the uiviewcontroller in my iphone application every time ..whenever i switch and come back from different view controller. Thanks!   the viewWillAppear
Orientation iPhone SDK
Orientation iPhone SDK In this tutorial we are going to show you how to set orientation in iPhone application. While developing the application in iPhone please keep in mind that landscape orientation is not possible in the case
Marketing orientation: way for marketing
Marketing orientation is the marketing approach in which need and demand... orientation emphasizes to the want and need of customer so that company can win the trust of customer for the future prospect. Marketing orientation practices
Customer orientation in marketing management
on customers demand and their taste. It is known as the customer orientation... are utilizing the marketing concept, which based on customer orientation. Although success... depends upon the customer orientation move. Such companies focus on the need
color change
color change  how to change the color in circle using scrollbar
Change Email
Change Email  Hi, I need to change my Rose India register email address for receive email, How did it possible
change password
change password  how to change password in the login form.... by giving options to user like this old password, new password.. pls help
password change
password change  Hi , I am using jsf and trying to write a code to change the password of a user . Ihave to retrine userid fromdata base how to do that using session
How to change background, change background
How to change background       This example will teach you to change background of any object... a picture to change background. Selection: Make selection by the Magic wand tool
How to change the face, change the face
How to change the face       You have a chance to learn how to change the face of the person to another face. It has very simple technique to make this effect
change xml dynamically
change xml dynamically  How to change an XML dynamically in Java
change content of cell javascript
change content of cell javascript  change content of cell javascript
change value of mutable string
change value of mutable string  How to change value of mutable string
change appearance of alert box
change appearance of alert box  how to change the appearance of an alert() box
change file permission in php
change file permission in php  How to change file permission in PHP
change uislider value
change uislider value  change uislider value   change NSSlider Value programmatically You can use the methods of NSControl. Example: [self.slider setDoubleValue:0.1
dynamic image change javascript
dynamic image change javascript  How to display images in JavaScript dynamically
php date format change
php date format change  How to change the date format in PHP
change value - Ajax
change value  hello buddy.........please help me i have a drop down box, i have to change my text box value acording to that drop down option.........(where all i need to change to use ajax in my application
To change font in java code
To change font in java code  I am sending system generated mail through MIME message and Transport. Now i need to change the font.. Can you please help me as how to change the font of string body in java code
Change Password - JSP-Servlet
Change Password  Hi all, Please kindly help me with jsp code and explanations to enable me write a change password program. This program will connect to mssql database 2000. Thanks
Change the name of the grades
Change the name of the grades  Hi, i'm developing with polar chart and i want to change the name of the grades, for example: add("variable name",5) insted of add(20, 5). Somebody know how to do it? Tanks
Change font in swing?
Change font in swing?  I want to use marathi language on labels,buttons
Java Spring Hibernate Struts Training Dont Post Inner Adv and Adult Content Adv . Conditional Statement in Turbo C Conditional Statement in Turbo C internship Latitude and Longitude of France Latitude and Longitude of Egypt Latitude and Longitude of Italy Latitude and Longitude of Switzerland Latitude and Longitude of United Kingdom Latitude and Longitude of United States of America Latitude and Longitude of Denmark Latitude and Longitude of Brazil Latitude and Longitude of Canada Latitude and Longitude of Mexico Latitude and Longitude of Zimbabwe Latitude and Longitude of Zambia Latitude and Longitude of Yemen Latitude and Longitude of Western Sahara Latitude and Longitude of Wallis and Futuna Islands Latitude and Longitude of Virgin Islands (US) Latitude and Longitude of Virgin Islands (British) Latitude and Longitude of Vietnam Latitude and Longitude of Venezuela Latitude and Longitude of Vatican City Latitude and Longitude of Vanuatu Latitude and Longitude of Uzbekistan Latitude and Longitude of Turkmenistan Latitude and Longitude of Uruguay Latitude and Longitude of United Arab Emirates Latitude and Longitude of Ukraine Latitude and Longitude of Uganda Latitude and Longitude of Turks and Caicos Islands Latitude and Longitude of Tuvalu Latitude and Longitude of Turkey Latitude and Longitude of Tunisia Latitude and Longitude of Trinidad and Tobago Latitude and Longitude of Thailand Latitude and Longitude of Syria Latitude and Longitude of Tokelau Latitude and Longitude of Tonga Latitude and Longitude of Togo Latitude and Longitude of Tanzania Latitude and Longitude of Taiwan Latitude and Longitude of Tajikistan Latitude and Longitude of Spain Latitude and Longitude of Sweden Latitude and Longitude of Swaziland Latitude and Longitude of Suriname Latitude and Longitude of Sudan Latitude and Longitude of Sri Lanka


Advertisement null