Orientation and Screen Sizes
Portrait, landscape, notches, tablets and foldables. What really happens when a phone rotates, why data gets lost, and how to test layouts on every screen your users own.
Maria is booking a hotel for a weekend in Porto on the train. She fills in her name, email and the guests, then turns the phone sideways to watch the hotel’s video tour. The video starts from the beginning. She turns the phone back to finish the booking. The form is empty. She sighs, closes the app and books on a competitor’s site instead.
Nobody on the team had rotated the phone in the middle of the form. On their test devices the screen looked fine in both orientations. It just forgot everything in between.
Why it matters
Users rotate their phones all the time: to watch a video, to see a wide photo, to type on a bigger keyboard, or simply because they put the phone down on a table. They also use many different screens: a small iPhone SE, a huge Pro Max, an iPad, a foldable that turns from phone to tablet mid-session, or a split screen next to another app.
Every one of these changes the space the app has. Two kinds of bugs appear:
- Layout bugs: content hidden behind the notch or home indicator, buttons pushed off screen, text stretched into unreadable lines, dialogs cut off.
- State bugs: on Android, rotation re-creates the screen. Anything the app didn’t save (a half-filled form, a scroll position, a playing video) is gone. This is a classic state persistenceState persistenceWhether the app remembers what the user did after navigating away, rotating, or restarting.Open in glossary → bug.
Portrait, landscape and rotation lock
OrientationOrientationWhether the device is held upright (portrait) or sideways (landscape).Open in glossary → is simply how the user holds the device: portrait (upright) or landscape (sideways). What the app does about it depends on three settings:
| Setting | Who controls it | What it does |
|---|---|---|
| Rotation lock / Auto-rotate off | The user (iOS Control Center, Android Quick Settings) | The screen stays in portrait no matter how the phone is held. Android shows a small rotate button in the navigation bar so users can rotate once. Landscape-only apps (some games, video players) still open in landscape |
| Supported orientations | The app (Info.plist on iOS, screenOrientation in the Android manifest) | Many phone apps are portrait only: banking, food delivery, social apps. Rotating the phone does nothing in those apps |
| Upside down | The app and OS | Face ID iPhones don’t support upside-down portrait; many Android apps don’t either. Tablets usually support all four orientations |
What happens when the phone rotates
The platforms handle rotation very differently, and that difference explains most rotation bugs.
By default, rotating the device is a configuration change. Android destroys the current screen (the Activity) and creates it again with the new size. It’s like closing and reopening the screen in a fraction of a second.
- Data the app keeps or saves for re-creation survives.
Dev note
Data kept in a ViewModel or saved with onSaveInstanceState (rememberSaveablein Jetpack Compose). - Standard text fields restore their text automatically, but custom views, timers, video players and network calls started by the screen are lost or restarted unless the developer saved them.
Dev note
Text fields need an ID for this. Composerememberstate is lost as well. - The same re-creation happens for other configuration changes: folding/unfolding, entering split screen, changing dark mode, font size or language, and connecting a keyboard. One test, many triggers.
Some apps handle rotation themselves. That avoids re-creation but can cause layouts that never update.
Dev note
android:configChanges.iOS does not re-create the screen. The same view controller stays alive, and the system tells it that its size and size classes changed. The layout is recalculated.
Dev note
- Data loss is rare, but layout bugs are common: constraints that only work in portrait, scroll views that jump, keyboards and dialogs that don’t fit.
- iOS describes space with size classes: compact or regular width and height. Most iPhones are compact width in portrait and compact height in landscape; the larger “Max/Plus” models get regular width in landscape. iPads are regular in both directions, until they are put into a split screen.
- The status bar is hidden in landscape on iPhone, and the safe area moves to the sides.
Safe areas: the parts of the screen you can’t fully use
Modern screens aren’t simple rectangles. They have rounded corners, a notch or Dynamic Island for the cameras, a home indicator at the bottom, and system bars. The safe areaSafe areaThe part of the screen not covered by the notch, Dynamic Island, rounded corners or home indicator.Open in glossary → is the rectangle where content won’t be covered or clipped. Backgrounds and images can extend beyond it, but text and buttons should stay inside.
| Device and orientation | Typical safe-area insets |
|---|---|
| iPhone SE, portrait | Top 20 pt (status bar), nothing else |
| iPhone SE, landscape | None at all (status bar hidden, no home indicator) |
| iPhone 16 Pro Max, portrait | Top 62 pt (Dynamic Island + status bar), bottom 34 pt (home indicator) |
| iPhone 16 Pro Max, landscape | Left and right 62 pt, bottom 21 pt, top 0 |
| iPad with Face ID | Top 24 pt, bottom 20 pt, in both orientations |
| Android phone | Status bar on top (often 24–48 dp, more around a camera hole), navigation bar or gesture handle at the bottom; since Android 15, apps targeting it draw edge-to-edge and must handle these insets themselves |
Notice that in landscape the iPhone’s island is on one side, yet iOS insets both sides, so content stays centered whichever way the phone is turned.
Points, pixels and dp
Screens have very different pixel densities, so apps don’t measure in pixels. They use logical units that look roughly the same size on every screen:
| Unit | Platform | Meaning |
|---|---|---|
| px (physical pixel) | All | One dot on the screen. A Pro Max has 1320 × 2868 of them |
| pt (point) | iOS | Logical unit. 1 pt = 2 px on @2x screens, 3 px on @3x screens. The Pro Max is 440 × 956 pt |
| dp (density-independent pixel) | Android | Logical unit. 1 dp = 1 px at 160 dpi; px = dp × (dpi ÷ 160) |
| sp (scale-independent pixel) | Android | Like dp, but also scales with the user’s font size setting. Used for text |
| CSS px | Web | Logical unit in browsers, similar to pt and dp. See viewportViewportThe visible area of a web page in the browser window or on the device screen.Open in glossary → |
For testers this matters because requirements, designs and bug reports speak in logical units. “The button is 40 pt tall” is a fact you can check against the 44 × 44 pt minimum touch targetTouch targetThe area of the screen that responds to a tap, which should be large enough for a finger.Open in glossary →; “the button is 120 px tall” means nothing until you know the density.
Users can also change the logical size: Display Zoom on iPhone (Settings › Display & Brightness › Display Zoom › Larger Text) makes a big iPhone behave like a smaller one, and Display size on Android (Settings › Display) changes the dp width of the screen. Together with font size (Dynamic TypeDynamic TypeThe phone setting that lets users make text bigger or smaller across apps.Open in glossary → on iOS), these are some of the most common sources of cut-off text.
Tablets, foldables and split screen
- Tablets have room for more: two panes (list + detail), sidebars, grids. A stretched phone layout on a tablet is a usability bug.
- Foldables change size while the app is running. A Galaxy Z Fold goes from a tall, narrow cover screen to an almost square inner screen. Flip-style phones have a tiny cover screen. The app must keep its state and switch layout, and avoid putting buttons right on the hinge.
- Split screen and windows. On iPad (Split View and Slide Over on older versions, Stage Manager, and the freely resizable, tileable windows of iPadOS 26) and Android (split screen, free-form windows on tablets), the app gets only part of the screen. A tablet app in a 50/50 split is suddenly phone-sized.
Android groups widths into window size classes: compact (under 600 dp: phones in portrait), medium (600–839 dp: tablets in portrait, unfolded foldables) and expanded (840 dp and up: tablets in landscape; newer guidance splits very wide windows further into large, from 1200 dp, and extra-large, from 1600 dp). Heights under 480 dp are compact (phones in landscape). These are good test buckets.
Try it: the device simulator
Switch devices, rotate, fold and turn the safe-area overlay on. Then switch off App respects safe areas to see what a careless app looks like, and add a few pizzas to the basket before you rotate: the basket should survive everything.
📱 Device simulator
Rotate, switch devices and fold. The sample app is rendered at the real logical screen size of each device, then scaled down to fit.
Luigi's Pizzeria
4.7 · 25–35 min · €1.99 delivery
Wood-fired Neapolitan pizza, made to order since 1998. Free delivery on orders over €25.
Pizza
Margherita
Tomato, mozzarella, basil
€9.50
Diavola
Spicy salami, chilli oil
€11.00
Quattro Formaggi
Four cheeses, honey drizzle
€12.50
Funghi
Mushrooms, garlic, thyme
€10.50
Calzone
Folded, ham and ricotta
€11.50
Tiramisu
Homemade, serves one
€5.50
Lemonade
Fresh, 0.4 l
€3.90
- Device
- iPhone 16 Pro Max
- Screen
- 440 × 956 pt
- Pixels
- 1320 × 2868 px (@3x)
- App window
- 440 × 956 pt
- Safe-area insets
- top 62 · bottom 34 · left 0 · right 0
- Layout
- Compact width → one column, basket bar at the bottom
- Shown at
- 47% (1 pt drawn as 1 CSS px)
What to notice
- Tap a “+” in the app to add pizzas, then rotate. Try the large phone in landscape, the tablet in split screen, and folding the foldable.
The keyboard and video in landscape
Two features get very tight in landscape:
- The keyboard. In landscape the on-screen keyboard can cover more than half of the screen. The focused field must stay visible, dialogs must move up or scroll, and the action button (Send, Apply, Log in) must be reachable. Some Android keyboards switch to a full-screen editing mode in landscape, which hides your app entirely while typing.
- Video. Users expect a playing video to go full screen when they rotate to landscape and return when they rotate back, without restarting and without losing the playback position, subtitles or quality setting. Picture-in-picture and AirPlay/Cast add more transitions to try.
What to test
Rotation and state
- Rotate on every screen with input, scroll position, selection, a playing video, an open dialog or menu, and during loading.
- Rotate several times quickly, and rotate while a network request is running (is it sent twice?).
- Change other configurations too: fold/unfold, split screen, dark mode, font size. See also Background and Foreground.
Layout
- Nothing important under the notch, Dynamic Island, camera hole, rounded corners or home indicator, in both landscape directions.
- Landscape uses the extra width sensibly; text lines stay readable (roughly 45–75 characters).
- Smallest supported phone, largest phone, tablet, foldable (folded and unfolded), split screen.
- Largest font size and Display Zoom / Display size, which together shrink the available space a lot.
Keyboard, dialogs and media
- With the keyboard open in landscape, the focused field and its buttons are visible or reachable by scrolling.
- Videos go full screen and keep playing across rotation.
Locked orientation
- With rotation lock on, rotating does nothing. In portrait-only apps, check that rotation can’t sneak in (for example through a video player or a web view).
Common bugs
| # | Bug | What you see | Typical severity |
|---|---|---|---|
| 1 | State lost on rotation | Form fields empty, selection reset, wizard back to step 1 | High |
| 2 | Content under the notch / island | Title, back button or first list item hidden or untappable in landscape | Medium–High |
| 3 | Content under the home indicator | Bottom button overlaps the home indicator; swiping up to go home taps the button instead | Medium |
| 4 | Video restarts or stays small | Rotating jumps back to 0:00, or the video doesn’t go full screen | Medium |
| 5 | Stretched layout | Phone layout scaled up to a tablet or landscape: 120-character lines, giant buttons, empty space | Low–Medium |
| 6 | Keyboard hides input | In landscape the focused field or dialog buttons are covered and can’t be scrolled to | High |
| 7 | Scroll position reset | Rotate halfway down a long list and you’re back at the top | Medium |
| 8 | Duplicate requests | Rotating re-sends a request (two orders, two messages) | High |
| 9 | Cut-off dialogs and sheets | A dialog is taller than the landscape screen and has no scrolling | Medium |
| 10 | Crash on rotation | The app closes when rotated during loading or with a dialog open | Critical |
Find the bug
This hotel booking screen supports both orientations, and it has six orientation bugs. Use the Rotate phone button below the device. Before each rotation, change something: type in the form, scroll, play the video, open the promo code dialog.
🐞 Bug hunt: Hotel booking
This demo has 6 hidden bugs. Explore it like a tester, then check your findings.
Casa Azul Boutique Hotel
4.8 (1,204) · Ribeira, Porto
A restored 19th-century townhouse a short walk from the river, with blue-tiled walls, a rooftop pool and views over the old town. Rooms have air conditioning, rain showers and blackout curtains. Breakfast with fresh pastéis de nata is served on the terrace every morning from 7:00 to 10:30.
Video tour
Your stay
Your details
Amenities
House rules
Check-in from 15:00, check-out until 11:00. No parties. Free cancellation until 48 hours before arrival.
Device
Scroll with the mouse wheel or by swiping. Type in the fields, play the video, open the promo code dialog, then rotate.
- 1
Hint: Fill in your name and email, then rotate.
- 2
Hint: Rotate to landscape and try to go back to the previous photo.
- 3
Hint: Play the video tour for a few seconds, then rotate to landscape.
- 4
Hint: Rotate to landscape and read the hotel description.
- 5
Hint: In landscape, open "Have a promo code?" and tap the code field.
- 6
Hint: Scroll down to "Your details" and rotate.
Tools and how-to
Xcode Simulator
- Rotate with Device › Rotate Left / Rotate Right (⌘← / ⌘→).
- Use File › Open Simulator (or Window › Devices and Simulators) to add the smallest and largest supported iPhones and an iPad. Check the app’s minimum supported iOS version to know which devices matter.
- Test iPad multitasking: on iPadOS 26, resize and tile windows with the window controls in the top-left corner; on older versions, use the ”…” multitasking control at the top center.
- Change Display Zoom and Larger Text in the Simulator’s Settings app; I/O › Keyboard › Toggle Software Keyboard (⌘K) brings the on-screen keyboard back if a hardware keyboard hides it.
Real devices
- Toggle Portrait Orientation Lock in Control Center to test both modes.
- Rotate in both directions: landscape left and landscape right put the Dynamic Island on opposite sides.
Android Emulator
- Rotate with the toolbar buttons or Ctrl+←/→ (⌘ on a Mac).
- Create a Resizable emulator, or the Pixel Fold and Pixel Tablet images, to switch between phone, foldable and tablet sizes and to fold/unfold from the extended controls.
# Lock rotation and force landscape (0 = portrait, 1 = landscape, 3 = reverse landscape)
adb shell settings put system accelerometer_rotation 0
adb shell settings put system user_rotation 1
# Pretend to be a smaller or denser screen, then reset
adb shell wm size 1080x1920
adb shell wm density 480
adb shell wm size reset
adb shell wm density resetDeveloper options
- Don’t keep activities destroys every screen when you leave it, a quick way to find the same lost-state bugs as rotation.
- Force activities to be resizable lets you put even “portrait-only” apps into split screen.
Mobile websites have orientation and safe-area bugs too.
- In Chrome DevToolsDevToolsDeveloper tools built into browsers for inspecting pages, network traffic and errors.Open in glossary →, open the device toolbar (Ctrl/⌘+Shift+M) and use the rotate button next to the device size.
- On iPhone, a page only draws under the notch if it uses
viewport-fit=cover; it must then pad content withenv(safe-area-inset-left)and friends. Test in Safari on a real iPhone or the Simulator in both landscape directions. - Rotation doesn’t reload a web page, but
orientationchangeorresizehandlers can reset forms, carousels or scroll position. See responsive designResponsive designA website layout that adapts to different screen sizes, from phones to large monitors.Open in glossary →.
Example test cases
TC-ORI-001Entered form data survives rotationpositivehigh
Steps
- Open hotel details
- Enter name and email
- Rotate to landscape
- Rotate back to portrait
Test data
Name: Anna Smith / Email: anna@example.com
Expected result
Both fields keep their values after each rotation, and the cursor stays in the same field.
TC-ORI-002Controls stay inside the safe area in both landscape directionspositivehigh
Preconditions
- iPhone with Dynamic Island
Steps
- Open hotel details
- Rotate to landscape left
- Check gallery arrows, back button and Book now
- Rotate to landscape right and repeat
Expected result
No text or control is hidden by the Dynamic Island, the rounded corners or the home indicator. All controls can be tapped.
TC-ORI-003Playing video continues in full screen after rotationpositivemedium
Steps
- Start the video tour
- Wait until 0:10
- Rotate to landscape
- Rotate back to portrait
Expected result
In landscape the video plays full screen from about 0:10 without restarting; in portrait it returns inline and keeps playing.
TC-ORI-004Dialog with keyboard is usable in landscapeedgehigh
Steps
- Rotate to landscape
- Tap "Have a promo code?"
- Tap the code field
- Type WELCOME10
Expected result
The field and the Apply button remain visible (or reachable by scrolling) while the keyboard is open. Tapping Apply applies the code.
TC-ORI-005Scroll position is kept after rotationpositivemedium
Steps
- Scroll to the "Your details" section
- Rotate the device
Expected result
The "Your details" section is still visible after rotation.
TC-ORI-006Unfolding a foldable keeps the basket and switches layoutedgemedium
Preconditions
- Foldable device or Pixel Fold emulator
- Two items in the basket
Steps
- Open the restaurant menu on the cover screen
- Scroll halfway
- Unfold the device
Expected result
The basket still contains two items, the same part of the menu is visible, and the layout switches to the two-column version without restarting the screen visibly.
TC-ORI-007Portrait-only app ignores rotation on phonesnegativelow
Preconditions
- Auto-rotate is on
Steps
- Open the app on a phone
- Rotate to landscape on every main screen, including video and web views
Expected result
The UI stays in portrait on every screen. No flicker, re-load or lost state.
TC-ORI-008Layout works at the smallest size with large textedgemedium
Preconditions
- iPhone SE (or smallest supported device)
- Display Zoom: Larger Text
- Text size: largest
Steps
- Open each main screen in portrait and landscape
Expected result
No text is cut off or overlapping, and every primary button is reachable (by scrolling if needed).
Tip: click a test case to expand it.
Checklist
Orientation and screen size checklist
0 of 11 checked
Check your understanding
Quick quiz
0/5 answered · 0 correct
1.On Android, why can rotating the phone clear a half-filled form?
2.An iPhone 16 Pro Max is in landscape. Where are the safe-area insets?
3.A design says a button is 120 px tall on a @3x iPhone. How tall is it in points?
4.Which situation can turn a tablet app into a phone-sized app?
5.What is the best way to find rotation bugs?
Key takeaways
- Rotation is a change of size. On Android it also re-creates the screen by default, so test that input, scroll position, video and dialogs survive it.
- Keep content inside the safe area: notch, Dynamic Island, camera holes, rounded corners and the home indicator. Test both landscape directions.
- Think in logical units (pt, dp), not pixels. Display Zoom, display size and font size change the space too.
- Landscape, tablets, foldables and split screen each need a layout that uses the space, not a stretched phone screen.
- The keyboard and full-screen video are the classic landscape trouble spots.
- Always change something, then rotate. And repeat the same checks for folding, split screen and other configuration changes.
Related: Gestures · Device Fragmentation · Simulators and Emulators · adb Basics
Finished this page?Nice work, this page is complete!
Mark it as done to track your progress. It's saved in this browser, no account needed.
Its review cards are now in Bites ⚡