ios - how to make uiviews only rotate (transform) when orientation changes? -


I'm looking to implement the same behavior as the iOS camera app. When orientation changes, thoughts and controls only roam in place, but keep the same situation. I have tried to set this type of position

  - (zero) Will Animatoration interface orientation: (UINFF) orientation operator period: (NSTEEInterval) period {CGTT Newbottom Control Foam; CGRect newTopControlsFrame; If (UIInterfaceOrientationIsPortrait (toInterfaceOrientation)) {CGFloat screenHeight = fmaxf (self.view.bounds.size.height, self.view.bounds.size.width); NewBottomControlsFrame.origin.x = 0; NewBottomControlsFrame.origin.y = ScreenHight - 70; NewBottomControlsFrame.size.height = 70; NewBottomControlsFrame.size.width = 320; NewTopControlsFrame.origin = CG pointmake (0, 0); NewTopControlsFrame.size = CGSizeMake (320, 50); Self.bottomControlsContainer.frame = newBottomControlsFrame; Self.topControlsContainer.frame = newTopControlsFrame; NSLog (@ "Frame:% F,% F,% F,% F", Newbottom Controllsframe.org.x, Newbottom ControllsFrame.Orgin., Newbot Controlls Fram. Size.width, newBottomControlsFrame.size.height); } And {CGFloat screenHeight = fmaxf (self.view.bounds.size.height, self.view.bounds.size.width); NewBottomControlsFrame.origin.x = Screenshite - 70; NewBottomControlsFrame.origin.y = 0; NewBottomControlsFrame.size.height = 320; NewBottomControlsFrame.size.width = 70; NewTopControlsFrame.origin = CG pointmake (0, 0); NewTopControlsFrame.size = CGSizeMake (50, 320); Self.bottomControlsContainer.frame = newBottomControlsFrame; Self.topControlsContainer.frame = newTopControlsFrame; NSLog (@ "Frame:% F,% F,% F,% F", Newbottom Controllsframe.org.x, Newbottom ControllsFrame.Orgin., Newbot Controlls Fram. Size.width, newBottomControlsFrame.size.height); }}   

The problem with that solution is that instead of maintaining their status, changing their way to the "new" place and making only the changes.

Thanks for your time! :)

I have found a solution to get this behavior, a < Pre> - (zero) willRotateToInterfaceOrientation: (UIInterfaceOrientation) should set the "new" state of the scenes in the Interface Orientation period: (NSTimeInterval) period [[UIView Set Animation enabled]. ; // Set new position ...} >

  - (zero) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) InterfaceArrayation {{UIView Set Animation Enabled: yes]; // Manually convert the animation}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -