IOS. How to rotate each subzone when switching between portrait and landscape modes

I am developing an iOS app in portrait and landscape, how would I get each sub-view in all animation views as they rotate, similar to how do the dock app icons do when switching from portrait to landscape on the iPhone 6P?

+3


source to share


1 answer


I would look into the TV settings and see if it has the ability to report itself as a 1080x1920px display.

Otherwise I would look at changing the bounds of the ViewController View to screenBounds but with the width and height changed, and setting the transform on the ViewController View to rotate 90 degrees

Something like:

self.view.transform = CGAffineTransformMakeRotation(CGFloat(M_PI_2))
self.view.bounds = CGRectMake(0,0,screenBounds.size.height, screenBounds.size.width)

      

Also you don't need



secondWindow.addSubview(self.view) 

      

and

secondWindow.hidden = true

      

how setting UIWindow.rootViewController causes the UIViewController view to be added and UIView objects are visible by default (UIWindow is a subclass).

+1


source







All Articles