Only Change Orientation on Function Call

Most of this question is in its title. I just can't seem to find any information regarding this. I would like to only change (between portrait and landscape) orientations on a function call, not by the user holding the device. Is there any way to do this in IOS? If the function is not called then the orientation shall remain the same regardless.

I also want this on a single view controller. If a user switches to another view controller, then normal functionalities shall resume.

Answers


Since you need this only in the current view, you can make use of UIView transform property. For eg:, if you want to rotate the view by 90 degress, use this,

view.transform = CGAffineTransformMakeRotation( M_PI / 2 );

You cannot do this. There are private apis that can let this happen but using them would cause a rejection from the App Store


Hi jab you can but the statusbar we cannot change without device orientation only the ui components which are available on view can change by changing their CGRect values(Frame values).


Need Your Help

Python for array in array

python arrays

I have four data sets that I am trying to call in order from a for statement. Is it possible to do something like this?

Accessing a static method in a static varibale definition

php class static-methods static-variables

I am trying to access a static class method in the definition of a static class variable. I have tried several attempts, but cannot get the code to compile.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.