screen-rotation

UICollectionView autosize and dynamic number of rows

北慕城南 提交于 2020-02-20 08:18:45
问题 I am trying to do something like this: Basically, I am using a UICollectionView and the cells (3 diferent .xib ). So far, it works. The thing I want to do is: Set a autoheight If rotate, add 1 row to the UIColectionView 2.1 If tablet, on portrait will have 2 rows and landscape 3 rows. (which basically is the same of point 2, only adding 1 row. I have something like this: extension ViewController { override func viewWillTransition(to size: CGSize, with coordinator:

Screen rotation glitch on iPadOS 13

坚强是说给别人听的谎言 提交于 2020-02-05 07:02:32
问题 I've been dealing with a UI glitch on iPadOS 13.1.3 that is related to device orientation. Is there any solution or workaround for this? Issue Description Let's have screen A that displays modally screen B. Screen A is locked to portrait only and screen B supports all orientations. If screen A is displayed, device is rotated to landscape then and screen B is about to be displayed, screen A is resized incorrectly first which results a wierd glitch. Images The left images is taken on iPadOS 13

Can't restore scroll position after rotation (RecyclerView)

♀尐吖头ヾ 提交于 2020-01-24 22:12:46
问题 Can't restore the scroll posiotn of RecyclerView after rotation and after I close the app and open it again. In the first case I could use android:configChanges in Manifest, but it doesn't help after I reopen the app. Here is my code. After trying restore the state I see an empty screen without my list. public class MainActivity extends AppCompatActivity implements IMainContract.View { private final String BUNDLE_RECYCLER_LAYOUT = MainActivity.class.getSimpleName() + ".save.state.list";

How can I find portion of my view which isn't covered by the keyboard (UIModalPresenationStyleFormSheet)?

霸气de小男生 提交于 2020-01-23 01:24:47
问题 I've got a view controller showing a view with a UITextView, and I want to resize the view when the keyboard appears so that the UITextView isn't covered by the keyboard. I have this working correctly in almost all cases. I'm still seeing some weirdness on the iPad, only when the view controller is presented in ModalPresentationStyleFormSheet, and only in LandscapeRight orientation, as far as I can tell. Relevant parts of my view controller's -keyboardWillShow: // We'll store my frame above

Saving/Restoring custom ArrayList on Android screen rotate?

北慕城南 提交于 2020-01-03 04:43:26
问题 I have a custom ArrayList of MovieItems that I want to save and restore on screen rotation. I checked out this post - How to save custom ArrayList on Android screen rotate? - and implemented and adapted some of the codes but the saving and restoring don't seem to be working for me. 1) Saving the ArrayList: public List<MovieItem> mItems = new ArrayList<>(); @Override public void onSaveInstanceState(Bundle outState) { outState.putParcelableArrayList(MOVIE_KEY, (ArrayList<? extends Parcelable>)

Swift manually rotate view controller

北城以北 提交于 2020-01-03 03:45:11
问题 So I'm working on an iOS 10 app using Swift 3 and Xcode 8.3.3. In my app I have to take successively 8 pictures with indicators on the camera. So I'm using AVCaptureVideoPreviewLayer for the custom camera and I need to set the view displaying the camera on landscape mode. I did it using this extension that I found on stackoverflow while searching for the problem. struct AppUtility { static func lockOrientation(_ orientation: UIInterfaceOrientationMask) { if let delegate = UIApplication.shared

Disable screen rotation in Qt

心已入冬 提交于 2019-12-25 09:20:06
问题 Is there a simple way to disable screen rotation in Qt for whole app? I just don't want to worry about that and simply disable it. I am using Qt 5.8 and targeting Windows. 回答1: It's pointless, because screen rotation from your perspective is the same as a screen resolution change, and if you turn that off, your users will be rightly hating you. If you wish to test your code for compatibility with screen rotation, emulate it by changing screen resolution. 回答2: The best way would be to disable

ios6 rotation problems

允我心安 提交于 2019-12-25 00:53:11
问题 I am converting my app to ios6 but i am getting rotation problems. Can some one help me which methods will be called when we rotate device 回答1: - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval)duration { [self doLayoutForOrientation:toInterfaceOrientation]; } - (void)doLayoutForOrientation:(UIInterfaceOrientation)orientation { if (UIInterfaceOrientationIsPortrait(orientation)) { //set the frames here } else { //set the

Bug with MKMapView's centerCoordinate during rotation?

泪湿孤枕 提交于 2019-12-24 00:16:32
问题 I think I may have found a bug in MKMapView , but I'd like to run it by folks to see if anyone else has run into this issue. I'm using iOS 7 and Xcode 5. In my storyboard, I have a view controller with an MKMapView in it. My app allows rotation to both portrait and landscape. I am using autolayout to keep the frame of the MKMapView updated when the user rotates the device. After rotation, it appears that MKMapView is reporting an incorrect centerCoordinate in the regionDidChangeAnimated

Android Front Camera recording video but plays upside down…!

浪子不回头ぞ 提交于 2019-12-23 02:39:48
问题 I have managed to create an android application to record videos but the problem is with the orientation of front camera video . The output is not the as per requirements . It gets automatically rotated . Application orientation is landscape . So, I need to record using front cam in landscape mode. Nothing is working out . 回答1: You might want to look at how the AOSP VideoCamera activity is implementing this: if (info.facing == CameraInfo.CAMERA_FACING_FRONT) { rotation = (info.orientation -