Question

I have a view that looks something like this:

enter image description here

It is a bigger view that contains two subviews, the gray band and the black band (the orange is a subview of the black).

I want to animate the black band sliding UNDER the gray. Currently, my animation moves the black OVER the gray.

I have not been able to figure out how to make the black slide UNDER the gray (I guess, in effect, clipping the black at the intersection with the gray, which would provide the illusion of sliding under the gray).

I have no idea whether anyone else can understand what I'm trying to do, but that's it. Any suggestions are appreciated.

Was it helpful?

Solution

When you add the black view insert it below the gray view:

[self.view insertSubview:blackView belowSubview:grayView];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top