I realize that by default a UIView is parallel to the X-Y plane, the Z-axis coming straight at you.
How do I rotate this UIView so that it is parallel to X-Z plane? I think I have to use CATransform3D but am not sure what angle I should give it? M_PI_2 or -M_PI_2 ?
Anybody has any idea? Thanks for help…
EDIT: I know that by doing this, the UIView will not be visible to the user, but I want to set a particular UIView this way & then do some rotation animation on it. So this is what I want..
WHat you probably want to do is to apply a transformation to the view’s backing layer. The
transformproperty onUIViewis an affine transformation, not allowing any 3D manipulation. But accessingview.layer.transformyou have a full 4×4 matrix for your transformation needs, allowing nice funky 3d stuff.QuartzCore.frameworkto your target.<QuartzCore/QuartzCore.h>to get access to theCALayerAPI.For example: