viewController not changing to LandScape mode in ipad - ipad

i am developing ipad related app.Login Screen not change to Landscape mode,i change Xib and used shouldAutorotateToInterfaceOrientation also but its didn't work out .can u help where the mistakes is there.i want app only landscape.

Related

iOS launch screen will appear in portrait instead of landscape

I am creating an iOS app that will support iPhone and iPad in landscape and portrait orientations. I have setup my launch screen storyboard with an ImageView and that appears correctly in both landscape and portrait modes in Interface Builder. However, even though I am holding my phone in landscape, the launch screen will always appear in portrait. I have logged my device current orientation in application didFinishLaunchingWithOptions, but it reports UIDeviceOrientation unknown. After the launch screen disappears, the first view appears in landscape as expected.
Do you know why that happens and how to fix it?
Thanks
I think that you haven't open this:

iphone keyboard is rotating into landscape while app setting is portrait only

My app’s device orientation is set to portrait, however when rotating the device into landscape mode, the app is keeping its portait mode but the keyboard is rotating into landscape mode...Something that is unexpected.
Why is that happening and how to prevent it?
Thanks
Jrejory
After not getting any answer and making more researches, I came across this Answer:
https://stackoverflow.com/a/6941930/4400274
Because I just needed the portrait orientation in my app the following worked for me :
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
I put that in my main Navigation Controller's viewDidLoad.
I know it's late. But maybe it will help someone else. I had the similar issue. My app should support portrait orientation for iPhone and all orientations for iPad. So, on the iPhone scene didn't rotate, but keyboard did. All my UI was made from code, I also init view controllers (including root) through code. But I didn't remove default Main.storyboard file. When I removed string in Target -> General -> Main Interface, it help me. It was not obvious.

iOS8 lock view controller orientation

I have 2 root view controllers ViewController1 and TabBarController1(there are reasons for making 2 root view-controllers). ViewController1 only supports Portrait mode and TabBarController1 supports all orientations. ViewController1 appears first after launch. I am locking the orientation of ViewController1 using the following method.
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
The app launch and orientation worked fine with iOS7.
When building the app through Xcode 6 in iPad(iOS8) following change is observed:
- When app is launched in landscape mode, ViewController1 with orientation locked into portrait mode appears with half black screen and when TabBarController1 appears which supports all orientations, doesn't resize with proper dimensions on changing orientations.
I have also tried overriding the above method in TabBarController1 to support all orientation but nothing works fine.
This problem is not observed when launching the app on iPad in portrait mode.
There is no problem when launching the app on iPhone as iPhone launches only in Portrait mode.
What is the issue when working with iOS8 ?
I am a newbie, so don't judge..
In ios8, apple changed 2 things :
1-
[[UIscreen mainscreen] bounds].size
This used to be a fixed value for portrait and landscape, now it is not.
When u change from landscape to portrait the width and height switch.
2-What is happening with you. You cannot force a viewcontroller to be in portrait only if you set portrait and landscape in project settings, do not know why, so you maybe have to set portrait only in project settings for example..
This is happening on iPads and iphone 6+ only.
Hope this helped..

IPhone landscape and portrait

I new to iphone app development i am trying to make simple app that contain registration page.
The registration view controller contain 10 textfield that are created on the uiscrollview using pro grammatically it working fine when it is in portrait mode ,when device changed to landscape mode,
textfield and scroll view coming in bad design and try to overcome this problem by using authorisizing property
not worked well.
plz help me to get out of this problem and i want my app should support both landscape and portrait mode.

iPad app to start in landscape mode

I searched for other existing posts, but none of them satisfied my requirements.
Here is the problem i face,
My app supports both the Modes , landscape and portrait.
But my first screen only supports Landscape , so the app must start in Landscape.
I have set supported Orientation to all the 4 options
I have set the Initial interface orientation to Landscape (left home button)
In the view controller of the first screen i am defining the below
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortrait);
}
And when i start the app the simulator always opens in Portrait and my view is all messed up in the portrait mode , since it is designed only for the landscape.
After the switch to the Landscape, the device remains in this mode.
can anyone help me with the solution to avoid this ?
Thanks
Naveen
EDITED :
This info may be helpful , The problem is faced only when i hold the device in Portrait and then launch the app.
Its not the duplication of this question, Landscape Mode ONLY for iPhone or iPad
Landscape Mode ONLY for iPhone or iPad
I do not want my app to be only in Landscape , i want only the first screen of my app to be only in Landscape.
I did some experimenting with an app I'm working on that has the same requirements, and came up with the following:
To set the initial orientations that are supported when the app is first launched, use the "Supported Device Orientations" setting for your target.
Also back that up with the appropriate shouldAutorotateToInterfaceOrientation code, as you've already done.
For subsequent screens, simply use the shouldAutorotateToInterfaceOrientation code to determine which orientations you want to support. Even if you've specified only landscape modes for the Supported Device Orientation, shouldAutorotateToInterfaceOrientation wins. :)
I think this approach is a little cleaner than using an extra dummy VC.
I achieved a workaround for the Problem and it solved ,
I created a dummy view controller and added as the root view controller of the Window.
Added the below method in the implementation
-(void)viewDidAppear:(BOOL)animated
{
WelcomeScreen *welcomeScreen = [[[WelcomeScreen alloc] initWithNibName:#"WelcomeScreen" bundle:nil] autorelease];
[self presentModalViewController:welcomeScreen animated:NO];
}
Now it worked as expected.
Here is a SO link that will hopefully answer your question on how to launch your app in landscape mode.

Resources