Page Curl Animation with Transparent UIImageView (iOS)

I have a ribbon (bookmark) that I want to curl from the screen. The ribbon has a clipping from the bottom, which is a transparent section - UIImageView with transparent png.

When I do the curl on the ribbon, the main shadow represents the whole view (which is technically square). I am trying to make this look as real as possible, so if someone could point me in the right direction, that would be helpful.

I tried - masking the view - adjusting the twisting of open source pages - replacing viewAtIndex while the page freezes - UIView animation

but they all lead to a square shadow.

The best experience I can provide so far is a simple UIView animation, while disappearing:

[UIView transitionWithView:_ribbonButton duration:0.5f options:UIViewAnimationOptionTransitionCurlUp animations:^{ [_ribbonButton setAlpha:0.0f]; } completion:^(BOOL completed){ [self animationCompleted:completed]; }]; 

Here is a screenshot: http://livevision.us/wordpress/?attachment_id=60

+4
source share
1 answer

I do not think this will be possible with UIViewAnimationOptionTransitionCurlUp. Animations in a view are based on all view boundaries, and not on the content of the view.

I think you will need to code something in OpenGL or in pre-processed flip animation or something else. There are a number of existing OpenGL solutions that you can download and configure.

+1
source

Source: https://habr.com/ru/post/1389772/


All Articles