Questions tagged [portrait]
Portait, in a mobile device, is that orientation where the width is smaller than the height. As opposed to Landscape
portrait
462
questions
352
votes
24
answers
238k
views
Flutter: how to prevent device orientation changes and force portrait?
I would like to prevent my application from changing its orientation and force the layout to stick to "portrait".
In the main.dart, I put:
void main(){
SystemChrome.setPreferredOrientations([
...
327
votes
12
answers
274k
views
Force "portrait" orientation mode
I'm trying to force the "portrait" mode for my application because my application is absolutely not designed for the "landscape" mode.
After reading some forums, I added these lines in my manifest ...
160
votes
11
answers
189k
views
How do I specify different layouts for portrait and landscape orientations?
I've seen references to being able to specify two separate layout xml files for an activity, one for Portrait and one for Landscape. I've not been to find any information on how to do that though. ...
146
votes
17
answers
169k
views
How to lock orientation of one view controller to portrait mode only in Swift
Since my app got support for all orientation. I would like to lock only portrait mode to specific UIViewController.
e.g. assume it was Tabbed Application and when SignIn View appear modally, I only ...
127
votes
8
answers
103k
views
Android - Camera preview is sideways
I am using a Preview to display what the camera see's on the screen.
I can get everything working fine, surface created, surface set and the surface is displayed.
However it always displays the ...
110
votes
4
answers
77k
views
Lock Android phone application to Portrait mode
Can someone tell me how to lock my application to a portrait mode? Is it a simple configuration in the manifest file?
55
votes
9
answers
50k
views
Find out if Android device is portrait or landscape for normal usage?
Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device.
Most phones have a portrait screen for normal usage but is there some ...
30
votes
2
answers
20k
views
Force portrait orientation while pushing from landscape View Controller
App Support: iOS6+
My app works in both portrait and landscape. But 1 controller should only works in a Portrait.
The problem is that when I am in landscape and push the view controller the new ...
27
votes
8
answers
26k
views
UISplitViewController: How force to show master popover in app launch? (portrait)
In an iPad App i'm using the UISplitViewController.
I need to force to show the master popover when the app launch in portrait mode.
Now I'm using this code and it works well on iOS 5.0.
if (...
26
votes
6
answers
14k
views
SwiftUI Force Portrait On All Except One View
I have a SwiftUI project. For all but one of the views, I want to allow portrait and only portrait mode. For only one view, I want to allow both portrait and landscape. There are some resources on ...
21
votes
2
answers
56k
views
css expanding based on portrait or landscape screen size?
I have two divs that are floating next to each other. What i would like is to have it have a width of 100px when you are looking at it in portrait mode and lets say 200 px in landscape. This happens ...
20
votes
3
answers
18k
views
Camera : setDisplayOrientation function is not working for Samsung Galaxy ACE with Android 2.3.6
I was trying to create a simple camera application for research.
I Read Android Camera Official Document and then started coding.
so I did some steps to get it work
1.Added required permissions for ...
18
votes
4
answers
10k
views
How do I lock screen orientation for phone, but not for tablet? (Android)
I have been working on a Android project, that is intended to be compatible with both the Android phones and tablets. On the tablet the app is working great and looks good too. However, on the phone ...
18
votes
5
answers
9k
views
Android zxing - portrait camera preview/surfaceview is stretched/warped
I have managed to use the answer here to rotate the camera preview to portrait:
http://code.google.com/p/zxing/issues/detail?id=178#c46
however the preview itself is stretched/warped - the height ...
17
votes
2
answers
47k
views
Android: Camera preview orientation in portrait mode
I'm using the camera to show preview only (not to take pictures or record videos).
The app is always in portrait mode (landscape mode is disabled).
The camera preview is always rotated 90 degrees ccw ...
17
votes
6
answers
7k
views
UISplitViewController not showing popup button when launching portrait
I am doing an iPad app based on a UISplitViewController. I have a little problem with the toobar button when my app launched in potrait. The button to show the popover is not displayed.
However when ...
16
votes
7
answers
43k
views
How to lock viewport to Portrait Orientation in HTML5/CSS3
Is it possible to lock the view port's orientation to portrait on a mobile device?
I Googled it but could not find out exactly how to do it.
15
votes
5
answers
16k
views
iOS 16 Scene orientation issue
I always received this error when I tried to allowed only portrait orientation on my controller:
Error Domain=UISceneErrorDomain Code=101 "None of the requested orientations are supported by the ...
14
votes
2
answers
27k
views
How to set app to be portrait only? [duplicate]
The only thing I can find is to use this:
android:configChanges="orientation"
android:screenOrientation="portrait"
but it stays as normal. My manifest:
?xml version="1.0" encoding="utf-8"?>
...
13
votes
2
answers
19k
views
Orienting iOS splash image to landscape/portrait according to launch orientation
I have an app that can launch in portrait or landscape. I'd like the Default.png file (the splash image that appears when the app launches) to show the image in the correct orientation so I expect I'd ...
13
votes
5
answers
47k
views
why does CSS background-size: cover not work in portrait mode on iOS?
I'm trying to set up a manualy splash-image across devices. I'm doing so by checking for orientation (touch devices) or screen width vs. screen height (none touch) and set a url accordingly.
Then I ...
13
votes
4
answers
9k
views
Phonegap/HTML5 and Android screen resize issue on rotate from landscape to portrait
I'm experiencing an odd problem with an android phonegap application right now when the user rotates from landscape to portrait, but not the other way around.
When the screen is rotated from ...
13
votes
4
answers
8k
views
Android VideoView not playing Portrait Orientation
THE PLATFORM:
Developing in Eclipse using Android SDK 16.
THE PROBLEM:
I have a VideoView element that is supposed to fill the entire screen in 480x800 (PORTRAIT ORIENTATION) and it plays fine, but ...
12
votes
5
answers
34k
views
Can a website force a device rotation lock?
I'm currently working on a website that is relatively equal for all devices; desktop & mobile. I'm working with % as I think that is the best option.
It's based on portrait mode. If you change ...
11
votes
3
answers
3k
views
Ipad in landscape mode and iphone in portrait mode
I need to set Portrait mode when my application is running in a iPhone and in Landscape mode when running in iPad.
I have change in info.plist but i can't set it for iPad or iPhone.
10
votes
1
answer
6k
views
Android (ActionBarSherlock) Is there any way to keep the same ActionBar height both in portrait and landscape?
I have been working with the ActionBar and ActionBarSherlock for the last few days, and i am having some issues when filling some information in the ActionBar.
When the application runs in portrait ...
10
votes
1
answer
4k
views
Android portrait video orientation wrong in VideoView
I capture a new video in PORTRAIT orientation on an Android device like this:
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, 1886);
and ...
9
votes
4
answers
25k
views
CSS responsive design - detect portrait display
I know it's with pure CSS possible to adapt the stylesheet according to screen dimensions, like this:
@media (max-width: 959px) {
/* styles for smallest viewport widths */
}
@media (min-width: ...
8
votes
3
answers
6k
views
Flutter Device Orientation
I wonder why Flutter does wonderfully rotate from Portrait to Landscape if run on an iOS device but does not rotate at all on my Android device ??
As a code example you find a "hello world" example ...
8
votes
1
answer
3k
views
Replicate camera app rotation to landscape IOS 6 iPhone
Hi I am trying to replicate the same rotation which can be seen in the camera app when orientation is shifted to landscape. Unfortunately I've had no luck. I need to set this up for the custom ...
8
votes
4
answers
5k
views
How do I make an HTML page print in landscape when the user selects 'print'?
We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but ...
8
votes
1
answer
3k
views
How to enable only portrait and reverse portrait in phones, "sensorPortrait" not working on phones?
I cant figure out why setting "sensorPortrait" attribute in manifest for an activity doesn't work to allow the activity to go into reverse portrait. This is how I set in manifest
<activity
...
8
votes
2
answers
10k
views
Only landscape mode works in iPad portrait orientation (CSS)
If you go here on an iPad, and click through to Chapter1 > Chapter 1 > Get started... you will see after a loading screen the Chapter 1 page.
Basically what this is, is html embedded into an ...
7
votes
5
answers
14k
views
Android portrait and landscape layouts
I have the following layout:
I need the following layout in portrait mode:
But instead of that I obtain the following one that I don't know how to modify it:
How can I do that?
7
votes
1
answer
1k
views
iOS asset sizes and design method
The code for my first iOS 2D game is written. Now, when it comes to assets I feel lost. One reason is the feeling of imperfection due to outdated articles.
I need to know the image sizes, to begin ...
7
votes
3
answers
3k
views
Camera only takes pictures in portrait mode swift
How can you set a camera into landscape mode? Everytime I take a photo, the image gets saved as a portrait image. When the device is in landscape mode the photo looks fine but if I see it in the ...
6
votes
5
answers
62k
views
3 media queries for iphone portrait, landscape and ipad portrait
I have tried the different combinations of width & device-width but on the iPhone in landscape this code never turns the background red;
I am having problem when I have more than 1 media query. ...
6
votes
4
answers
3k
views
Xcode: Need to lock game to portrait only
I just released a game to the app store and realized I completely forgot to lock it to portrait only. I need to submit an updated version that does just that. At this point, is it enough to just go ...
6
votes
4
answers
5k
views
How to target only landscape mobile devices without affecting desktop via CSS?
Is there a simple way to target landscape mobile devices without affecting desktop ones, without entering the screen size for every device?
If not, is there a single best resolution to target most of ...
6
votes
3
answers
8k
views
Cannot rotate interface orientation to portrait upside down
Both on iPhone simulator and iPhone 3GS (iOS 6) I cannot manage to set the orientation to portrait upside down. I have just one ViewController. I've added this code in it:
-(BOOL) shouldAutorotate{
...
6
votes
1
answer
7k
views
android:screenOrientation="sensorPortrait" doesn't work on API +17
I want my application to work in Portrait & reversePortrait mode .. In other words, I want it to work in portrait and make it rotatable 180 degrees!
I'm using the following code within <...
5
votes
4
answers
12k
views
How to manually set the device orientation when App Deployment Info portrait is locked?
I dont want my app to be landscaped and always be porttrait.So i made my app Deployment Info to set portrait only. but when i need to display any image or videos in my app,i need landscape mode for ...
5
votes
3
answers
19k
views
Android Video not fitting the width in portrait of the videoview and not occupying full screen in landscape
Android video not fitting the width of the videoview when in portrait, how can i make the width of my video fit the width of my videoview when in portrait, and when i change orientation of the screen ...
5
votes
2
answers
16k
views
How to force iPad Safari not to scale down my web page in portrait mode?
I am publishing a free book online in HTML5 format and i said it would be great if i could optimize it for the iPad even though i don't have one.
So i started working on the design and that idea was ...
5
votes
4
answers
20k
views
How to find out if ipad is in landscape/portrait mode in javascript/jquery?
I want to add an extra div if the ipad is in landscape mode.
Is there some sort of if statement that could find this out?
Thanks
5
votes
8
answers
8k
views
lock UIImagePickerController in Portrait mode in ios app
In my IOS app, when I open the camera I have placed an image over the camera view. It looks good in portrait mode. But when it is changed to landscape mode it looks some odd. So I want to lock the ...
5
votes
3
answers
2k
views
Create two equal height columns of random portrait and landscape images in PHP
Given a random number of portrait and landscape images, I am trying to write PHP code to output two columns of equal height:
By assigning the value "1" to landscape images and "2" to portraits, my ...
5
votes
2
answers
8k
views
How to convert & rotate raw NV21 array image (android.media.Image) from front cam portrait mode in onImageAvailable (android Camera2)?
Note: All info in my post only goes for Samsung Galaxy S7 device. I do not know how emulators and other devices behave.
In onImageAvailable I convert continuously each image to a NV21 byte array and ...
5
votes
1
answer
3k
views
Exploded portrait HDMI output on Android (Samsung Galaxy S III)
Currently, when you connect an external monitor to an Android phone that supports mirroring, the phone makes the assumption that the external monitor is set up in a landscape orientation. Thus, when ...
5
votes
2
answers
5k
views
Android - ImageView showing image from Gallery in "landscape"
First at all, maybe "landscape" isn't the better word to describe, but i can't think another one in the moment.
I'm using the following code to show an image in an ImageView, but my image that was ...