I am trying to set a wallpaper, When i view it in Portrait mode then it actually sets what i see, but when i switch to landscape mode a bit gets cropped.
When i view it in landscape mode and then switch to portrait my image shifts upwards leaving a black border of about 150px because i switched from landscape to portrait.
This is because the viewport of a phone being 1920x1920 instead of the actual used size of 1080x1920.
Is it possible to set a different wallpaper for each view (either landscape or portrait) ? without using a live wallpaper.
the viewport size is being retrieved using mWallpaperManager.getDesiredMinimumWidth() and mWallpaperManager.getDesiredMinimumHeight() where mWallpaperManager is an instance of WallpaperManager.
Related
16:9 portrait
But screen ratio is not 16:9.
And the left and right sides of the screen are not displayed.
16:9 Landscape
More like a square than 16:9.
18:9 Portrait
1920x1080 Portrait
same as them.
I suspected the camera rotation.
But there was no problem.
Camera rotation was 0 in xyz.
Why?
My enviroments:
Windows10
Unity2020, 2021(After I have this problem in 2020, I upgraded 2020 to 2021.)
build setting: android
If portrait mode screen Size is good and while i'm changing into Landscape mode screen size is different. I want to use both XML layout should be same screen size.
Right now I have two different layout files, one for Large and one for large-land. Both are using constraint layouts. However whenever the tablet switches from portrait to landscape mode, the landscape mode layout displays correctly. But after switching back to portrait and back to landscape mode, the landscape layout no longer displays correctly. The right side of the layout seems to have extended past the actual screen.
To simplify,
Portrait -> Landscape: Landscape displays correctly
Portrait -> Landscape -> Portrait -> Landscape: Landscape layout breaks and extends past the screen for some reason.
Any idea why this may be happening? Thanks in advance!
I have a device on which I set portrait orientation, but it shows the activity in landscape. The device width is bigger than its height, so it seems to be inverted. What can I do to have this device working like the others?
Note that this device has a keyboard; see this image.
I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs).
I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one.
How can I do this?
You can use onConfigchange method in that setContentView(R.layout.name) this way will work.