Anyway to force landscape mode in iOS7..? - uiviewcontroller

is there any correct solution to force the navigation based view controller to landscape mode in iOS7?
If yes, please give me a correct solution.
Note that iOS 7.
I don't want answer for iOS6 or iOS5
UPDATE:
In my case I have an app with more than 10 view conrollers(with Navigation controller).
thats all supports only portrait mode only except one viewconroller.
That one view controller must change to landscape. Then goto next view controller with portrait mode.
Note: iOS7.

Related

How to adjust the orientation of UIViewControllerWrapperView (in IOS7)?

Background: The application is an iPad app running in Landscape only. When upgrading the app to Xcode 5 and running in the IOS7 simulator, I noticed that some buttons on the right side of the screen were not fully active. i.e. only a fraction of the left side of the button was clickable.
Observation: Running the same source code in IOS6 and IOS7 simulators, and viewing the view hierarchy using the REVEAL tool, I can see that the dimensions of the UIViewControllerWrapperView (the parent of my top level view controller) are landscape for IOS6 (1024x768), but portrait for IOS7.
I am trying to find a way to set the frame of the UIViewControllerWrapperView to the correct dimensions. In the view controller's viewDidLoad method, I tried to get a reference to self.view.superview, but it returns nil.
Can anybody explain; a) why the UIViewControllerWrapperView's frame is in the wrong orientation when running in IOS7 and not IOS6, and more importantly b) how to make it right?
Are you using a UITabBarController? We were having exactly the same issue and got it working by adding this on the UITabBarController:
- (void)viewDidLayoutSubviews
{
// fix for iOS7 bug in UITabBarController
self.selectedViewController.view.superview.frame = self.view.bounds;
}
Why? check this answer

HTML5 camera input strange behaviour in fullscreen

I´m writing a webapp for an iPad with HTML5, JavaScript and jQuery. My users need to take pictures with the build-in camera. For that reason I am using input type="file". This works great in different browsers (Chrome/Safari Mobile) but the problem is that when I add my app to the homescreen and take a photo in lanscape fullscreen mode- iOS brings up the camera from the wrong side. To be clearer iPad in landscape mode camera slides in from the left side(should be from the bottom). It behaves like it was called from portrait mode and the picture has a dark part on the left side. The camera window automatically changes the orientation - I debugged it - twice (0°/-90°). When I finish taking the picture and return to the app it is displayed in portrait mode, even though holding it on landscape mode. And additionally the screen is somehow locked. Thsi behaviour doesen't occure holding the iPad in portrait mode. Anyone an idea how to solve this strange behaviour? I found that question but no answers...

How to apply landscape mode for Game Center View Controller in iOS6

I am working with COCOS2D game. Now i have updated my game to iOS6. I have seen that Apple has changed Game Center login(authentication) process. So for that i have used handler authenticateWithCompletionHandler and nw my game is crashing.
I have also solved this issue via adding method.
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
That fixed my crash. But now issue is Game-Center authentication view comes only in portrait mode. As my whole game is in Landscape mode. i want that authentication view in Landscape.
Does anyone provide me any solution for this issue.
Thanks in advance!!!
Currently there is no landscape view for the authentication screen in Game Center for iOS6.
Whether this was an oversight by Apple or deliberate we don't know. Many people are expecting a fix to come with the next release but it is just hearsay at the moment.
All you can do is what you have already done. It is possible to only allow portrait for iOS6 small screen devices as a workaround. Any device running iOS5 and iPads don't have to be in portrait and should function correctly.

Testing/mocking an orientation change in Chrome?

We're writing a mobile app using jQuery mobile and do most of the javascript debugging in Chrome. One thing I can't test however is an orientation change, from portrait to landscape and vice versa. I have to use a phone to fire that event, and am unable to debug the javascript window.orientationchange event without Chrome.
Or so it would seem. Is there a way to mock this event in Chrome somehow?
Since a desktop device doesn't have any real orientation changes, like mobile devices does have, it's no use to listen to orientationchange. You could simulate orientation by resizing the browser window though.
David Walsh wrote an article about this: http://davidwalsh.name/orientation-change
A way to test your media queries based on orientation:
The Window Resizer extension for Google Chrome enables you to view and test your site in either portrait or landscape orientation. When installed, it has a size predefined of 320 x 480 and the orientation returned by jQuery using $.event.special.orientationchange.orientation() will be "portrait". I added a new size of 480 x 320 for landscape and indicated a "Screen Type" of mobile. In 480 x 320 size, the orientation returned by jQuery using $.event.special.orientationchange.orientation() will be "landscape".
This does not allow you to test the orientation change event specifically, but it is very useful for testing media queries based on orientation.

How to restrict browser view to Landscape on a mobile browser in HTML5?

How to restrict browser view to Landscape on a mobile browser in HTML5? On potrait view, it should display "Switch to landscape mode" and load when it is turned to landscape mode.
you can use the "onorientationchange" event of your browser. I extracted a working example from one of my testing projects: http://jsfiddle.net/r9b8D/
Its not exactly what you are looking for, but it shows the implementation of "onorientationchange". Copy the jsfiddle example to your host and navigate to the site with your mobile phone to see what happens - Maybe you can navigate to jsfiddle with your phone, i am not sure.
Feel free to modify the example to fit your needs.