Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS Core Animation - Fold a Layer
    text
    copied!<p>Using Core Animation, I would like to fold a <code>UIView</code> (i.e. it's <code>CALayer</code>) on it's center. i.e. I would set the anchor point as (0.5,0.5) &amp; fold the layer. This image that I created in Photoshop might give the effect I am looking for - </p> <p><img src="https://i.stack.imgur.com/7hvuu.png" alt="enter image description here"></p> <p>So, what's happening is, the layer is being folded on its center, as the fold is happening a little bit of perspective is applied (the infamous <code>m34</code>!). Initially, the view is parallel in X-Y plane with Z axis looking straight to the user. As the fold is happening, bottom half &amp; top half at the same time move back (with some perspective, to give depth &amp; 3D effect) till the entire layer is (parallel) in X-Z plane. Note that once the layer is parallel in X-Z plane, the user will no longer be able to see the Layer. But that's ok, that's the effect I am looking for. A <code>UIView</code> disappearing by folding on it's center.</p> <p>How would one go about doing this in <code>iOS</code>? Without using 2 different layers (for bottom &amp; for top)? Any help is much appreciated...</p> <p><strong>Update:</strong> As @miamk points out, this is the same UI effect used in <strong>"Our Choice"</strong> App or <strong>"Flipboard"</strong> App. I am wacking my brains out for the last 8 hours on this, so far fruitless. ANY idea is appreciated. Thanks...</p> <p><strong>UPDATE:</strong> I have offered bounty on this to get more specific answers. Would love to see - </p> <ol> <li>Code samples.</li> <li>Advise from people who have done something like this. </li> <li>Even the way to achieve this in a detailed fashion (algo) is much appreciated.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload