ios - How do we rotate 2 UIView planes simultaneously in 3D space -


I am trying to create a "page flip effect" by using UIView instead of CALayer due to a project limit For 1 UIView flipping 180 degrees and essentially "pasting it" requires behind the other UIView. Then you simultaneously rotate two UIViews together in 3D space supervision.

I am trying to port UIView to UIView instead of UIImage.

Below it is a snippet of the port's own effort. The initial page flip works, but the "front layer" does not appear in the code like I can not see the backend of the page. When I flip the page, the animation is initially correct (the back layer is fine), but then on the other side of the page (front layer), I see the reverse view of the backlit.

Any help will be awesome!

  flip animation layer = [[UIView alloc] init]; Flip Animation Layer.layer.anchorPoint = CGPointMake (1.0, 0.5); Flip Animation Layer.layer.frame = rect; [Auto addDeviewview: flip animation layer]; UIView * backLayer; UIView * frontLayer; If (FlipDirection == AFKepPlatformDirectionRight) {backLayer = currentViewSnap2; BackLayer.layer.contentsGravity = kCagravityLeft; FrontLayer = nextViewSnap2; frontLayer.layer.contentsGravity = kCagravityRight;} and {backLayer = nextViewSnap2; BackLayer.layer.contentsGravity = kCagravityLeft; Front Layer = Current ViewSnap2; frontLayer.layer.contentsGravity = kCagravityRight;} backLayer.frame = flipAnimationLayer.bounds; Backlayer Layer. Two sided = no; Backlayer.clips tubons = yes; [Flip animation layer isaSubeweview: backlayer]; FrontLayer.frame = FlipAnimationlayer.bound; FrontLayer.layer.doubleSided = NO; FrontLayer.clipsToBounds = Yes; Front Layer Layer.Transform = CateringForm 3DMarketation (MPI, 0, 1.0, 0); [Flip animation layer viewpoint: front line]; If (flip diary == AFKepageFlipterDirectRightRight) {Catranfores 3D Transform = Catransform 3DMarketation (0.0, 0.0, 1.0, 0.0); Conversion M34 = 1.0 F / 2500.0F; Flip animation layer Layer. Transform = transform; CurrentAngle = startFlipAngle = 0; EndFlipAngle = -M_PI; } else {CATransform3D transform = CATransform3DMakeRotation (-M_PI / 1.1, 0.0, 1.0, 0.0); Conversion M34 = 1.0 F / 2500.0F; Flip Animation Layer Layer. TransSoft = Transform; CurrentAngle = startFlipAngle = -M_PI; endFlipAngle = 0; }    

Your code is rotating the layers, not the view. It's okay.

I hope that the code that was posted to animate you, because the backing view of a layer does not contain the embedded animation, you can revive it using CABasicAnimation. Or, you can create layers for your front and rear views and add them to the layers of your scenes as a subhelp. If you do this, then unbalanced animation will be used instead of transforming the layers.

According to what I said, what I did to make my own font-to-back flip, this is fake.

I animate in 2 steps: first to zero degrees (flat) to 90 degrees (where the layer disappears.) At that time I hide the first layer and the second layer appears, rotates 90 degrees On the other hand, and then rotate the second layer over zero, it creates visual effects similar to showing the face behind the rotation.

If you use the built-in layer animation to do this, you will need to change the changes inside the KatrinaCircle block and set the animation time for linear, or use it easily for the first half And for the second half, this is because the animation is at least, for a comfortable time, and before the 90th degree the animation will eventually slow down, and then another 90 degree animation Will be reduced.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -