I have heard a few conflicting comments regarding the default orientation of the iPad.
Some say it is portrait (how I tend to use my iPad), however some say it is landscape.
I have this sort of thing in my CSS to target elements when the device is in portrait mode, however I find I don't have the same sort of scaling problems with landscape and hence have no need for the media query below.
#media all and (orientation:portrait) {
}
I can't find anything anywhere that says for sure what the default orientation is for the device. Is there one?
There is no default. Both are allowed and equally important. The fact that you only have problems with portrait is most probably just a consequence of this specific site's design, for others you'll have to do the same on landscape.
Since landscape presents a 1024px wide browser to the user it's also less probable to cause issues since desktop sites are historically nearly always 960 to 1050 pixels wide as well. That doesn't make it the 'default' though, just less likely to cause problems.
It's actually identical to asking what the default screen size is for a desktop browser - it doesn't have one, you can resize it at will. Rotating your iPad is for all intents and purposes just that, a sudden resize of the browser.
Related
I have a game we're trying to release in the app store for iphone and ipad, and while it works fine on all of our devices (a handful of iphones and ipads), when the app store reviewers try it the actual viewport they see is highly cropped and distorted.
This is an example options screen that the reviewer saw:
This is what that options screen looks like for us on an equivalent aspect ratio/resolution:
As you can see, it's just a small, off-centered square for them, surrounded by black. But we've tested this on devices like an old iphone 5 up to big ipads and have never seen anything like this, the game takes up the full screen and the aspect ratio is correct and not distorted or stretched.
One important detail is this is entirely an OpenGL and SDL program, not using any Apple UI frameworks at all. The render size is determined by SDL_GetRendererOutputSize(), which then is used in glViewport(), and the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag. This so far has seemed to work with both retina and non-retina physical devices.
Also all of the screenshots they've given us look the same, same little square viewport surrounded by black, so I originally thought they were cropping them on purpose to highlight specific components of the screen, but this appears to be just exactly how it looks for them as this square is in the same position in each screenshot. I've asked them for more information on their devices but they wouldn't tell me.
We also have the program set to only ever use landscape, not portrait, but the weird thing is that with the way our UI reflows, the only way to get that button to look squished the way it does there is if the game was somehow still rendering in portrait, as seen this example shot I took by forcing it to run in a very tall portrait window:
I don't even know where to begin to try to figure out what's going wrong for them though, because as I've said, everything looks fine when running in an emulator and everything looks fine when we've run it on several physical devices. Is there some build or release configuration I could be missing? Some OpenGL setting I should check? I'm just hoping this problem looks similar to something someone else has encountered before.
If you are on an equivalent device, then another thing that may differ is the accessibility settings. Search for display zoom in settings. Also, try locking the iPad into portrait mode before launching your app to try and reproduce.
Note the little double arrow icon in the lower right corner of the reviewer’s screenshot. I don’t know what that is, but it looks like it could be some kind of screen zoom or accessibility mode. Perhaps they can answer what it does, and how to enable it for yourself.
To follow up with the solution that worked for me, I noticed that in my project's General settings in Xcode, under Deployment Info, I had only checked iPhone and not iPad. What I've since learned is that without that checkbox, some iPads will have to run in an emulation mode, which may have been the source of our problem. Deploying a new build with that checked (as well as "requires full screen"), it rendered exactly the same on our own iPads, but the app was subsequently approved with no further problems. I had made no other changes to the program, so my assumption is that that setting likely fixed it.
1.) We have a universal iOS app that incorporates split view and slide-over for iPad. Just right. For iPhone, on the other hand, we do not want to use these features.
2.) Split view does not appear for smaller iPhones, even in landscape, which is the desired behavior. Just right, again. However, larger iPhones in landscape mode do by default, utilize split view, which is not the desired behavior.
3.) Split view on larger iPhones can be disabled at the user level(iOS 14): settings -> display and brightness -> view and select "Zoom". That does achieve the intended result. However, user may not find that feature desirable for all of their apps across their device. It also requires a certain level of user sophistication to figure this out. For these reasons, that is not a viable solution.
4.) There is an info.plist option called UIRequiresFullScreen, which achieves the intended result for iPhone, however it also disables split screen and slide-over for iPad, which is not the intended result. We want this only to apply to iPhone. That is therefore not a viable solution either.
Seems there is likely a simple solution to the problem of turning off split view for larger iPhones for a universal iOS app, so the larger iPhones function just like the smaller iPhones. Thoughts?
Responder dfd helped steer our thinking back on the right track. The solution is not to try to remove the iPhone splitViewController feature of iOS, but as dfd pointed out, we should embrace the feature. Thinking in splitViewController mode, rather than trying to force the larger iPhone to be a smaller iPhone, the behavior we are looking for in landscape view on larger iPhones is:
splitViewController.preferredDisplayMode = .primaryHidden
Calling this preferredDisplayMode on rotation on iPhone provides just the solution we were looking for. Thanks to all who took the time to review our question!
Hi so I've been playing around with XCode and can't seem to figure out how to make an application landscape only. Wondering if there is a simple/storyboard solution.
I've tried checking the landscape left and landscape right and unchecking the portrait on the general page under "device orientation".
However this strangely just displays the w Compact h Regular set up on my storyboard horizontally (as opposed to showing the W Any h Compact set up). I mean technically I can work around this, but it seems annoying/inefficient to rotate my head 90 degrees while working on the portrait settings.
If there is only solution in code, I would appreciate it in swift!
EDIT: Hmmm, after some testing it seems as if the phone I'm testing on only shows the rotated version of the portrait settings. It's an iPhone 4 and maybe outdated for handling 2 seperate set ups for portrait and landscape.
Thanks!
Just for anyone with this problem in the future, here's the problem:
The storyboard editor by default will display the editor as any by any, as it should. Size classes should ONLY be used when you need to change something specifically for one kind of size class (in other words, things that will be different on different devices. You should still edit everything in the any x any orientation, and regardless of if it's landscape only because size classes will still change from device to device for landscape orientation.
It's an iPhone 4 and maybe outdated for handling 2 seperate set ups for portrait and landscape
That could be it. Size Classes were invented in iOS 8. So on a system earlier than iOS 8, they are not supported, and your results will be, shall we say, unpredictable.
When I look at my website on ipad peek portrait, it does not zoom out the appropriate size. It may be that my design does not allow for enough fluidity. I am confusing, however because it did seem to work at some point.
Please see http://www.nogginusers.com/libermanproperties/libermanproperties.html
and a standard media stylesheet for ipad portrait
OK, I have a question regarding launch images on the iPad and orientation. Again, this is specifically regarding, launch images and has nothing to do with rotation/orientation once the application actually gets control.
Anyway, the Default.png resource is always loaded, regardless of orientation of the device, regardless of supported orientations, and regardless of Initial Interface Orientation. It just appears that the app is considered to be in Portrait until it is (possibly) auto-rotated later. I read something to this effect on the apple dev stuff, but given that there are launch images for these different orientations (Default-Landscape, Default-LandscapeLeft, etc.) I presumed that orientation was not fixed at launch.
The simple solution was to rotate my Default.png 90 degrees so that it is at least dimensionally correct, but that is not an acceptable solution unless it is the only solution. I did come across a reference to a folder called 'Resource-iPad' but have not been able to dig up much info in that regard.
Both the device and simulator seem consistent. I am targeting iPhone/iPad. Resources are in the root of main bundle, etc.
So, I must be missing something obvious, but I am not sure what and that is where you guys come in.
Thanks in advance,
Tom
If your app is universal, make sure you have two images for the iPad version -- one named "Default-Landscape~ipad.png" and one "Default-Portrait~ipad.png". Be careful of the tilde vs. dash in the names.
If it isn't universal, then just "Default-Portrait.png" and "Default-Landscape.png" should work. Not sure why it isn't working for you. Maybe having "Default.png" and "Default-Landscape.png" isn't an acceptable combination for the OS, in which case change Default.png to Default-Portrait.png
I know that most (if not all) landscape Splash Screens are made by rotating the picture 90°. This usually reflects the intended orientation once the app loads, and helps the user turn their iOS device accordingly.