Lately, I have received a text from the QA folks saying that the developed app's orientation is incorrect on iPhone 3, while it can display correctly on iOS 4. They say on iOS 3, the app's orientation is on portrait view, which makes the app leaving gray space below. However, they claimed that on iOS 4, the orientation is correct.
I test their claims on my 3GS (using iOS4). My app is always rendered correctly on my iPhone. It's pretty strange, because:
The app has been developed before the release of iOS4, and the codes for rotation is left intact. This implies that the rotation works correctly for iOS3 in the past.
I run my app using base 3.2.3 version, and I could not produce what the QA is claiming. This applies to both the simulator (tested on both iOS 3.2.3 and 4) and the actual device. (which uses iOS4)
The rotation works since iOS3, and it also works on iOS4 on my iPhone.
This is a very strange case, and without being able to reproduce the bug the QA is claiming. So in this case, I need some advice, could you possibly list out all of the methods for the orientation? This is overkill, of course, but without able to reproduce their claims, I really need a way to force the app to always force orientation on a landscape view.
So I've jotted the following:
edit the plist for initial interface orientation for landscape orientation.
application setStatusBarOrientation method. Possibly do this in the viewWillAppear method of the ViewController.
in the method: shouldAutoRotateToInterfaceOrientation, set the desired orientation only.
Any help is really appreciated.
Okay, I think I now know what's really going on, after trying things on my own. The orientation is already always on landscape, and all I need is manual translation of the view for older iOS. iOS4 seems to be smart enough to handle this, I presume?
If your rotation code is setup correctly, you should need to have any version specific cases. If views do not reply with YES to shouldAutoRotateToInterfaceOrientation: for the orientations you desire, you will get unexpected results for automatic rotations.
Related
I've looked around and tried different things but none of them seem to work well.
I want to be able to push a view which is supposed to be portrait only when the device is currently orientated in landscape and the other way around.
I've setup shouldAutorotate, supportedInterfaceOrientations and preferredInterfaceOrientationForPresentation properly. They work when the device is manually rotated. However fails if the device isn't rotated. Once rotated, they work as expected. It's only the initial presentation that doesn't work.
Is there a way to force the OS to make calls to the above methods? I tried "present modal view controller hack". This worked fine on 6.0 but doesn't do well on iOS 7.0.
So, is there any way to get this to work? Or do you guys suppose asking the user to rotate the device before pushing the view to be a better solution?
Looking forward to your replies. Do keep in mind, I need support for both iOS 6 & 7.
Thanks,
Nathan
If it's working properly after the rotates, perhaps all it will take is to run part of your code in the viewDidLoad.
Never ask the user to rotate (or do anything for that matter) to get something working properly. It would give a very negative user experience, in my mind at least. All it takes is a little more time and effort to get it working properly. :)
My app uses the UIGetscreenImage () method to take a Screenshot, which works perfectly fine using iPhone simulator or an iPhone.
Now I wanted to use my app, that is targeted for iPhone on my iPad too.
Doing so, the Screenshot will only be the upper right corner of the iPad display, in the size of an iPhone display.
Changing the app target to iPad would fix the problem, but screws the complete UI, so it is a rather bad fix.
You know some other way to fix the problem?
Using the UIGetScreenImage method is no problem, as it isn't targeted for the AppStore, and I like the advantage of the statusbar included in the screenshot.
But if their is no other way to fix it I can also use another method for making screenshots.
thx for your help :)
I've got a very strange behavior in my iPhone app.
The app should run in any orientation. Plist keys are all set and shouldAutorotateToInterfaceOrientation always returns YES.
Also, it's an iPhone only app, but at this moment I can test it only on the iPad.
Now, when I start it in portrait mode, everything works fine. However, if it launches in landscape mode, the view doesn't receive any touch input, buttons and gestures simply don't work. This is happening as long as the window remains unaltered. If I rotate the app and then rotate it back to landscape, it works. Moreover, if I press the "2x" button on the iPad, the app also starts to work normally.
I've checked all view frames and everything is drawn correctly.
When run in simulator, it ignores the initial orientation and draws itself in portrait mode.
What can be the reason and how to solve it?
I have found that this is unique to iOS 6 (you'll see this on iPads running iOS 6 and even the iOS 6 iPad simulator, but not devices/simulator running iOS 5). If you remove all of the entries under "Supported interface orientation" in the app's plist, this problem seems to go away. Alternatively, if you check the "Hide during application launch" option for the "Status Bar" settings on the Summary screen of the Target settings, this also fixes it:
It makes no sense why either of these should fix the bug, but they appear to.
If you use the "Supported Orientations" tweak, in iOS 6, you can still programmatically control the permitted interface orientations via supportedInterfaceOrientations (in iOS 5, you can still useshouldAutorotateToInterfaceOrientation:).
So after wasting many hours trying to get my app to run in landscape mode by defualt I'm looking for an alternative.
My idea is to create the app in portrait mode but rotate everything by 90 degrees, the player thinks that he is playing the game in landscape mode (when really I've just rotated everything). I recognise it will be a little awkward to develop but I come into all sorts of issues when I try to program for landscape.
My question is, does Apple frown upon this? Could they reject my app for any reason or is this safe to do? Are there any issues I should be aware of?
Advice/articles/help all appreciated.
I do not allow landscape mode in my applications and none of them have been rejected. Sometimes an application does not benefit from being in landscape mode.
EDIT: The same also goes for portrait mode. If your app makes sense only in one orientation or the other, Apple will not reject you.
There is a key you can put into your Info.plist to make it start in landscape (see here). Or have you already tried that?
There are reportedly immersive full screen Open GL games that hide the status bar and do this. Note that you will still need to detect and handle landscape-left and landscape-right rotations or your app might appear upside-down.
Just set an affine transform on your top-level view, and be careful to always use the correct coordinate system.
Apple recently decided to allow developers to use this UIGetScreenImage private API.
I have implemented it and it works fine in portrait, but when I run the device to landscape (self.view rotates) and UIGetScreenImage continues to capture using the screen non-rotated coordinates.
The result is a cropped landscape result.
UIGetScreenImage is the only method that works in my case, as far as I know and until you guys don't find an answer to this other question of mine :-)
I believe you need to apply the rotation yourself.
UIGetScreenImage() doesn't care about the orientation. In fact it cannot, because there can be multiple UIWindows on screen while some are autorotated, some are not.