503 questions
356
votes
53
answers
193k
views
RecyclerView: Inconsistency detected. Invalid item position
Our QA has detected a bug: when rotating the Android device (Droid Turbo), the following RecyclerView-related crash happened:
java.lang.IndexOutOfBoundsException:
Inconsistency detected. ...
1
vote
1
answer
797
views
Locking rotation to portrait on SwiftUI without the use of AppDelegate or SceneDelegate
I'm trying to lock the rotation of my application using a bunch of methods that apple have now deprecated over the years and I'm at a loss.
There isn't a SceneDelegate or AppDelegate in Xcode projects ...
1
vote
0
answers
130
views
Fix portrait orientation in Android application for tablet (Jetpack Compose)
As per the title, I am trying to lock the rotation of my application in Portrait but I am not succeeding, being developed for tablet every time I try to rotate the simulator, the application rotates ...
0
votes
1
answer
97
views
androidx.compose.foundation.layout.ConsumedInsetsModifier cannot be cast to androidx.compose.ui.input.pointer.PointerInputModifier
I am facing this an issue when changing from between screen sizes (Tavle, Foldable, Phone) in the Android Emulator:
java.lang.ClassCastException: androidx.compose.foundation.layout....
0
votes
0
answers
47
views
How can I force a full screen video to rotate along with the screen?
I'm trying to rotate the screen of the user's device. So far, the code below works great on all devices I've tested except the Amazon Fire TV Stick. While the screen does rotate, any video playing in ...
1
vote
1
answer
157
views
How do I rotate the screen of an android device by a certain number of degrees?
I wear a smartwatch (Galaxy Watch 4) with the screen facing my wrist, and for greater convenience, I would like to rotate the screen not 90 degrees, but approximately 40-45 degrees. Unfortunately, I ...
0
votes
1
answer
11k
views
Why does my Samsung Galaxy S21 not rotate the display [closed]
My Samsung Galaxy S21 has suddenly decided that when I rotate the phone between portrait and landscape mode, it won't rotate its display unless I touch the soft-button which briefly appears.
How can I ...
54
votes
5
answers
57k
views
How to save custom ArrayList on Android screen rotate?
I have an ArrayList with custom objects that I would like to be able to save and restore on a screen rotate.
I know that this can be done with onSaveInstanceState and onRestoreInstanceState if I ...
89
votes
13
answers
48k
views
How to handle an AsyncTask during Screen Rotation?
I read a lot on how to save my instance state or how to deal with my activity getting destroyed during screen rotation.
There seem to be a lot of possibilities but I haven't figured out which one ...
1
vote
1
answer
678
views
IOS16 portrait rotate issue
Hi I wanna fix the bug which occur in IOS16 for rotation screen
I refer to this article, but it's still not working....
BTW we used the Object-c instead of Swift
Reference
UIWindowScene *...
0
votes
0
answers
34
views
Restore Instance State without calling onCreate after rotation
I am working on an app to keep track of scores in a grid like format. I am using Kotlin and Room Database to store everything (playerId, gameInstanceId...). The storing works perfectly fine and every ...
0
votes
1
answer
80
views
How to stop the screen rotation in android?
I want to prevent my app from the rotation, but I don't want to specify the screen Orientation in every activity tag in the manifest file instead I want to define it only once in my application which ...
1
vote
1
answer
191
views
How do you detect that a UITextView has re-flowed its contents?
The background: I answered a user question about how to create a blurred image of a text view's contents using simple demo code.
I then decided to generalize my solution and refactored my demo app to ...
0
votes
0
answers
140
views
Screen rotation when launching PyQt5 application on linux without X server
I have orangepi4 running on ubuntu server without xorg and mipi display for it. By default, the screen orientation is portrait.
I have developed a PyQt5 application that, when launched with an hdmi ...
38
votes
12
answers
24k
views
UIImagePickerController camera view rotating strangely on iOS 8 (pictures)
I have a very simple application:
- All orientations are permitted with only a button on a screen
- The button show a UIImagePickerController (to take a photo)
- Build with Xcode 5 and SDK 7
On iOS 8,...
34
votes
9
answers
26k
views
How to maintain presenting view controller's orientation when dismissing modal view controller?
I have this app I am working on and I need ALL my view controllers but one to be in portrait.
The single one view controller that is special I need it to be able to rotate to whatever orientation the ...
0
votes
0
answers
143
views
endGeneratingDeviceOrientationNotifications not working in iOS 16.7?
I have an Objective C app that includes an 'orientation lock' switch, that allows users to switch off response to device orientation changes during some functions, so that rotating the device doesn't ...
49
votes
6
answers
46k
views
Retain the Fragment object while rotating
I have developed an app in Honeycomb and I am using fragments.
This is my app
I have an Activity (Say A1) and in that there is a fragment
Initially this fragment hold the object one fragment object ...
0
votes
2
answers
2k
views
iOS 16 prevent UIViewController from rotation
I have an UIViewController that supports all UIInterfaceOrientationMasks
But, in one certain case I need to prevent it from rotation
Before iOS 16 i was just handling this case like this
override var ...
1
vote
1
answer
2k
views
React Native automatic screen orientation
I have been facing a problem with React Native screen orentation. I am using expo and run my app through expo go on an Android device.
According to the documentation:
Multiple screen orientations ...
6
votes
0
answers
2k
views
Screen Orientation Rotation in swiftUI in iOS16
I am working on an app which uses viewcontrollers and I am slowly migrating to use views built using SwiftUI.
I am working on new swiftUI views, so i am setting UIHostingController as the ...
-2
votes
1
answer
232
views
iOS UIKit StackView and handling device rotation properly
I'm working on an app that uses a Scrollview -> StackView -> button, imageview, textview view hierarchy. (I'm building the view programmatically rather than using storyboard. I'm using a ...
0
votes
0
answers
577
views
Fragment not associated with a fragment manager after screen rotation in Android
I have a problem I can't solve. I have two fragments, one called "NotificationListFragment" that can navigate to a second fragment called "InfoNotificationFragment". Before calling ...
1
vote
2
answers
2k
views
Maintaining state through screen rotation in Kotlin
There's really no code snippet for this. I'm building an Android app in Android Studio in Kotlin with a main activity in both default portrait and lanscape modes. I'm using Android Studio auto-...
2
votes
1
answer
686
views
How to change orientation of some pages in iOS 16 in Xamarin Forms?
I want to change orientation of some pages in my app in Xamarin Forms.
I am using Visual Studio 2019 for Mac and Xcode version 12.4
I have used DependencyService. It is working fine till iOS 15 but ...
36
votes
9
answers
44k
views
iOS 6 rotations: supportedInterfaceOrientations doesn´t work?
I´m having this issue with iOS 6 SDK: I´m having some views that should be allowed to rotate (e.g. a videoview), and some that don´t.
Now I understand I have to check all orientations in the app´s ...
0
votes
1
answer
122
views
Android app that starts in phone's current orientation but doesn't reorient
I'm new to Android and making some toy apps to try things out for my own amusement.
I want to make an app that starts in whichever orientation the user is holding the phone but then stays in that ...
1
vote
1
answer
210
views
Fixing reposition of Done when rotating in SFSafariViewController
I am fairly new to iOS and am a bit stuck on this issue. The problem is that when I rotate the device from landscape to portrait in SFSafariViewcontroller the DONE button gets pushed up. See image ...
4
votes
3
answers
16k
views
How to unlock rotation on one screen in react native
I tried using react-native-orientation in a webview to get it being the only view that would rotate.
import React, {useEffect} from 'react';
import { WebView } from 'react-native-webview';
import ...
34
votes
5
answers
44k
views
PhoneGap - Forcing Landscape orientation
I started looking into PhoneGap yesterday and created a simple "marble" rolling around while tilting the phone. I am currently developing on Android but I want the orientation to stay as landscaping ...
0
votes
1
answer
192
views
How to lock ImageView orientation in Activity?
How to lock ImageView orientation when rotate screen in Kotlin? simply how to freeze ImageView (as background) when rotate activity?
Trying:
I tried to change a image in LinearLayout as background,
...
0
votes
1
answer
130
views
How to rotate CALayer and cover complete View on device rotation?
I have applied a gradient to a custom UIView by adding a CAGradientLayer. While this works fine there is small glitch when rotating the device and the view + layer with it. For a short moment the ...
0
votes
1
answer
208
views
Updating tapGesture area(frame) after device is rotated SwiftUI
I have an issue with updating the area(frame) of .onTapGesture after a device is rotated. Basically, even after changing @State var orientation the area where .onTapGesture works remain the same as on ...
32
votes
8
answers
8k
views
Allow video on landscape with only-portrait app
I have a UIWebView included in a UIViewController which is a descendant of UINavigationController. It looks like this:
The app is portrait only. When I play the video I want the user to be able to ...
9
votes
1
answer
7k
views
Android Studio API Level 28: Rotating emulator does not rotate the app contents or device UI
Foreword. I know this question has been asked several times in the past, but none of the solutions have actually worked for me. It's also been several years since a similar question has been asked (...
2
votes
2
answers
761
views
changing height of a custom keyboard when rotating
I have a customized keyboard created by code, it is a unique input view for a specific textfield. I implement this in my project:
let keyboardContainerView = KBContainerView(frame: CGRect(x: 0.0, y: 0....
1
vote
1
answer
2k
views
Unity SafeArea is inconsistent between different starting rotations
I'm trying to make a script that adjusts the SafeArea of my Canvas when the device is rotated. I've got it almost working and it looks great on-launch, but I'm getting a weird result after rotating ...
11
votes
1
answer
2k
views
How to disable the device rotation animation in SwiftUI?
For UIKit to disable the device rotation animation you could override the viewWillTransitionToSize method.
Disable orientation change rotation animation
But what would be the best way to achieve this ...
19
votes
4
answers
26k
views
Detect rotation changes in iOS
I am making an iOS app that needs to do a little interface rearrangement upon rotation. I am trying to detect this by implementing - (void)orientationChanged:(NSNotification *)note, but this gives me ...
0
votes
1
answer
334
views
Swift: Selectively prevent auto screen rotation with SpriteKit scenes
I have an iOS application that will have a number of SpriteKit scenes. These scenes should remain in the same orientation on the screen in both portrait and landscape. For example one scene will have ...
1
vote
1
answer
662
views
How to handle screen rotation with bottom navigation menu where each menu refers to a new viewpager with limited tabs (3-4)? I am Using ViewModel
I am having Bottom navigation menu, and each menu is having their separate viewpager with 3 tabs. Everything works fine in portrait mode but once rotate the device Viewpager is reset to that of first ...
0
votes
1
answer
57
views
How do you activate the Android Emulator's screen-orientation switching to emulate responsiveness?
This is a question that I actually know the answer to from discovery today, and I'd like to share the answer with you and also with my future self who might have forgotten.
So the problem is that by ...
0
votes
0
answers
62
views
Calculate rotation of a vertically held android phone in javascript
I am attempting to calculate a full 360 degree rotation from a captured starting angle while the phone is being held vertically in either portrait or landscape.
I can easily get a starting angle by ...
1
vote
0
answers
335
views
Screen get abnormal when I rotate screen using java on Android TV api 29
I am rotating the screen from landscape to portrait but the screen works abnormally when I do this. The screen size gets small.
The app is working fine in android API version 23 but with 29 this issue ...
1
vote
0
answers
348
views
iOS ReplayKit locks screen rotation and prevents auto-roatation of iPhone/iPad
I experience a weird issue when working with Replay Kit. Specifically, when I call startCapture, the app no longer responds to rotations. It locks the current orientation
RPScreenRecorder.shared()....
0
votes
1
answer
383
views
savedInstanceState bundle is always null after device rotation
(I know this question has been asked many times before, but none of the answers that I have read have helped.)
After I rotate my device, my fragment is recreated but the Bundle received in onCreate/...
0
votes
1
answer
184
views
How to fix my onSaveInstanceState and onRestoreInstanceState?
I'm trying to save all the values & clicks from user during screen rotation, but my button click and text view isn't working. I've spent so many hours trying to figure out what to write inside ...
1
vote
0
answers
824
views
How to deal with temporarily incorrect SafeAreaInsets?
I'm working on a nice screen rotation animation in my iOS app.
When the screen's size changes, I update the (Metal) model inside it accordingly.
The problem is that I have visual content "jumps&...
2
votes
1
answer
2k
views
Lock orientation and disable rotation on iPad
I've got the following code which works fine on iPhone, but not on iPad. It should lock the orientation on landscape and disable autorotation only for THIS viewcontroller (not for the whole app - NOT ...
20
votes
3
answers
5k
views
Stop only iPhone screen rotating in Universal Xcode 6 project
With the introduction of Xcode 6, Apple removed the ability to easily have multiple storyboards for iPad and iPhone in Universal apps. Due to this, you cannot differentiate between iPad and iPhone on ...