How to do android dialog flip animation?

How does iPhone orientation change animation work?

  • I am Android developer and I'm curious how the nice orientation change in iOS apps done -- from developer and from iOS point of view. In Android, apps are restarted on orientation change, there's no animation. How hard would it be add support for this animaton to Android OS?

  • Answer:

    For regular applications using the UIKit framework, the orientation animation is automatic. The application nominates (usually in the application properties in Xcode) which orientations are supported. (i.e. portrait, landscape-left, landscape-right, and upside-down). Then at runtime, of the accelerometer detects the user has changed the orientation, the application gets a message -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation so it can decide dynamically to allow certain rotations. The developer can also customise the layout of the user interface in the new orientation to optimise the sizing and positioning of interface elements. Interface Builder can be used to describe constraints which let the system automatically adjust the layout. If the system-derived layout is not enough, it can also be programmatically specified. This is described in the Apple iOS reference documentation: https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/RespondingtoDeviceOrientationChanges/RespondingtoDeviceOrientationChanges.html If the application is an OpenGL app (for example, most games) the rotation must be done by the developer. This is relatively easy to do. The application needs to track the current and target rotation angle, and use a timer to adjust the increment and call glRotatef() in the drawing method. This is fully described in Chapter 1 of "iPhone 3D Programming" by Phillip Rideout. http://www.amazon.com/iPhone-Programming-Developing-Graphical-Applications/dp/0596804822/

Gavin Baker at Quora Visit the source

Was this solution helpful to you?

Other answers

In iOS there are methods (overridable) that are called before and after the orientation has changed.

Cesare Rocchi

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.