503 questions
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
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
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
795
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
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
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 ...
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 ...
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
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 ...
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 ...
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 ...
-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
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
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
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 ...
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 ...
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 ...
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,
...
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 ...
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 ...
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 *...
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 ...
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 ...
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
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-...
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
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
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 ...
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/...
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 ...
0
votes
1
answer
437
views
Disable app rotation if resolution is small
I am currently working on an Android App written in Kotlin with Jetpack Compose. My goal is to get a responsive app that runs on smartphones and tables responsively. To do this I get the user's curent ...
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&...
0
votes
1
answer
650
views
Why is the logic of retrieving SafeAreaInsets in `viewWillTransitionToSize` slightly wrong?
I'm exploring if the landscape "Safe Area insets" can be presicely known in viewWillTransitionToSize when rotating from Portrait to Landscape.
I've seen this SO answer, its code is rather a ...
0
votes
1
answer
910
views
button disappears after screen rotation
I have a simple app that has a Button and a TextView, when I try screen rotation, the TextView stays same while the Button disappears as below.
The Button comes back when I rotate the screen again.
...
-1
votes
1
answer
332
views
Screen rotation problem in viewmodel with dagger-hilt with injection
I have a problem with injection dagger into view model.The problem is that losing form inputs when rotating the screen.Is the problem in my injection or initialize my view model? Here is my viewmodel;
...
0
votes
1
answer
32
views
OnScreenRotation with RecyclerView in tabbed Activity
I am using a tabbed Activity. In one of the tabs I have two buttons and a Recyclerview. In the RecyclerView I have two spinners and an edittext.
The purpose of the first button is to add a new item in ...
0
votes
0
answers
88
views
How to Run only one function in onCreate on every rotation of a device in android studio
For every rotation of a device onCreate function is called and all data lost. But I need to run a particular function in onCreate for every rotation of device.
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 ...
0
votes
1
answer
524
views
Android screen rotation not taking effect
May I check how can I rotate screen via code in Android?
The device (Android 6 ARM CPU) I am using does not have sensor to detect orientation change and I need to do it manually. The problem of this ...
3
votes
0
answers
3k
views
How to handle screen rotation problems with Mozilla Firefox
I have problems with the screen orientation in Mozilla Firefox. It seems to me that screen.orientation is not supported in Firefox.
We are building a SPA with Angular 9 and using webrtc inside of it, ...
0
votes
1
answer
202
views
Set Rotation based on device sensor overriding rotation lock
I have been trying to use the ML Kit Vision Quickstart Sample App to develop a blink detection app.
For this, I have been using the Face Detector module with the CameraX library.
On installing the ...
2
votes
1
answer
490
views
Why does extented layout on landscape mode shows half black screen in Xamarin Forms?
I have two Views and two content pages, in one I have them arrange vertically and it's shown when the device is on portrait mode, something like this:
<StackLayout>
<Grid>
...
0
votes
1
answer
105
views
manage fragment appearance upon screen rotation in xamarin.android
after I thought that I finally finished my android app, I discovered that when my phone screen rotates, my application crashes. so after doing some research, I figured out that I have to add this line ...
2
votes
1
answer
484
views
How to clamp z rotation of a gameobject using touch input in unity without creating a jitter on y rotation
I am able to clamp the z rotation of my game object using the code below, but it always changes the y rotation on my first touch. I only want to rotate the z-axis.
private float zRotation;
public ...
0
votes
1
answer
327
views
SwiftUI navigationBarItems: 'cycle detected through attribute' error on device rotation
I'm getting very strange error messages with Xcode 11.5. Having device rotation support enabled, I get a bunch of error messages telling me "=== AttributeGraph: cycle detected through attribute ...
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....
0
votes
2
answers
1k
views
safeAreaLayoutGuide not updated after rotating the device
I present a UIViewController out, which uses autolayout to set the constraints for the sub views inside the view of the view controller. all the constraints are kept in the code, without
storyboard ...
0
votes
1
answer
654
views
How to change position of image for portrait or horizontal alignment in XCode 11
I am trying to take an image from filling the right hand side of the screen when viewed in horizontal orientation, to the top quarter when viewed in portrait.
I've followed lots of guides and points ...