I'm working with media queries for iPhone. I noticed that when I flip my phone from PORTRAIT to LANDSCAPE, everything gets bigger.
For example, the NAV is taller on PORTRAIT. What's really weird, though, is the Inspector says it's the same height for both orientations: 90px.
What the hell is going on?
How can an element that has the same height be bigger on different orientations?
Thanks!
Related
Hello stackoverflow community,
I have just added the constraints to my iPad app and would now like that if you hold the iPad across that you can scroll the page, because not everything fits on a transverse page. If the Ipad is upright you should not be able to scroll (there everything fits).
How can I make that happen?
Edit:
I would like to be able to use landscape mode on my app, which I originally designed to be portrait only. For this I have already inserted all constraints so that the size etc. fits. Now, however, the page is so full that it no longer fits on the complete display in landscape mode. Now I would like to be able to scroll down and thus the complete page is on the display. How it looks at the moment in portrait and landscape format I have loaded into the attachment (do not wonder the app is in German).
Landscape
Portrait
add your views into UIScrollView and set its contentsize, you can thencontrol what should be visible or scrollable for both portrait and landscape
I use LaunchScreen.storyboard as my launch image. It works ok when the devices are portrait. When i launch the app on landscape mode on ipad or iphone7 plus whe image was stretched.How can i use two different image for portrait and landscape mode.
Thank you.
You can set another image based on the size class traits. Unfortunately this does not help with left and right landscape rotation (you can only have an image for one of them). Also it is kind of base on the fact that for current iPhones landscape can be detected by having a compact height trait. This may change in future.
I am having an issue with "autorotation". I have AutoLayout constraints that function correctly if the phone is rotated from Portrait to Landscape Left or Landscape Right. But if the phone is rotated from either landscape orientation to the other landscape orientation but going "360 degrees" instead of back into portrait first, then the layout looks like it thinks the phone is in Portrait Orientation.
I'm allowing all orientation except upside down. I've tried enabling upside-down orientation but the phone never rotates into that orientation, it just stays in landscape.
What is the appropriate way to deal with this?
I abandoned the approach using AutoLayout and instead used UIView + NSAutoLayout. This let me easily set all the constraints programmatically and everything worked much better.
In my iPad app, i am supporting only portrait mode except on one screen. I have tab bar at bottom, on click of any tab,it opens a small view of size 320.0 * 600.0, with table view. On selecting any row in small view, a full screen view opens up. Problem is that when i came on full screen view which supports all orientations, next time,my other view especially the small view comes up with frame size of 768 * 1024.
Any sugeestions or help is appreciated!
I'm guessing the problem is that you read the frame size while still being in landscape mode. If you are running things in the simulator, it probably jumps back to portrait when you dismiss the full screen? This forces the app back to "portait" mode without triggering the normal "willRotate" functionality, and could possibly mess up your code for keeping track of orientations.
Also keep in mind that most apps needs to support all orientations on the iPad to get accepted, unless you're making e.g. a game which is normally specifically designed for either landscape or portrait.
I have my app supporting both portrait and landscape modes. But once I switch it from portarait to landscape, it does not autosize. The page is displayed just in half the total display frame available. Can some one suggest me the code I need to put in?