My UIViewshould always be in fullscreen but that doesn't really work sometimes. Every time the user rotates the device, the method viewWillLayoutSubviews gets called.
Here I print the height and width of the UIView.
The height and width of the UIView are right (1024 width,768 height in landscape mode).
Anyway, on the iPad the View hasn't this size altough I write it to the Console.
In portrait mode everything works, but in landscape not so what could be the problem?
If the iPad is in landscape mode and I start the app it works but if I rotate it (then it's portrait) and rotate it back to landscape, the view isn't in fullscreen anymore.
UIView rotation doesn't work properly in Swift
721 Views Asked by mafioso At
1
There are 1 best solutions below
Related Questions in SWIFT
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Swift code with multiple NSDateFormatter - optimization
- How do I add multiple in app purchases in Swift Spritekit?
- cellForRowAtIndexPath and prepareForSegue return different label colors
- Getting this message in my console in xcode "Ignoring restoreCompletedTransactionsWithApplicationUsername: because already restoring transactions"?
- Change background of an Accessory View in a UITableViewCell
- fade in an bounce animation subview
- Create a PFObject and PFRelation after PFUser Sign Up
- Swift 2 - Pattern matching in "if"
- How do I give inputs through NSURL
- How do I add custom cells to TableView in Swift?
- UIWebView not loading URL in simulator
- Compiler complains that 'Expression resolved to unused function' when removing index in array of functions
- Cast from 'Int?' to unrelated type 'NSNumber' always fails
Related Questions in UIVIEW
- Enable user interaction for gesture recognizer during UIView.animateWithDuration()
- Swift - Changing UIView programmatically while keeping IBOutlets (File's Owner)
- Changing UIView's xib file and file owners code on UISegmented controller switch
- Objective c keyboard opens unwillingly
- Create a UIView title of a push view using the index of an array
- iOS CGRect is inside another CGRect
- Drawing in UIView on touch points gives blurr drawing effect on boundaries
- How to vertically center two views & divide the width equally relative to the super view?
- On xib, dragging view will automatically go inside a bigger view
- Make a UIView stick to bottom of the ViewController frame in Swift
- How to convert a UIView to an image
- Draw/Paint like sketch color inside a bezier path in UIView
- Scene Kit: projectPoint calculated is displaced
- How to send a UIView element backwards in Swift
- UIView animation not smooth, jerky on repeat
Related Questions in DEVICE-ORIENTATION
- Launching landscape app according to iOS human interface guidelines
- UITableViewHeader doesn't maintain position when device rotates
- UIView rotation doesn't work properly in Swift
- Arbitrary direction for DeviceOrientationControls
- Detect phone rotation in Javascript Windows Phone mobile application
- DeviceOrientationEvent: how to deal with crazy gamma when beta approaches/hits 90deg?
- How to present a view controller in portrait or landscape, in application that is portrait-only
- Set iPhone native popup's orientation
- Compass not working on my mobile devices in Chrome 39
- iOS8 Device appears stuck in portrait, but rendering landscape
- Get HTML5 deviceMotion events fire at a higher rate
- Autolayout and Device Orientation
- Set UITextVIew position on device orientation
- My app does not support Portrait mode but at times it turning into portrait mode
- Auto rotation or the views
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Simply pin the edges of your UIView to the edges of the view controller's main view with
constantof 0, once when you add the UIView to the interface, and all will be well thereafter.