mardi 5 mai 2015

How Rotation of Relative Layout in android works?

I have the following relative layout (the pseudo-code of it):

<RelativeLayout id="container">
      <ImageView id="one" background="@color/Green"/>
      <ImageView id="two" background="@color/White"/>
      <ImageView id="three" background="@color/Yellow"/>
</RelativeLayout>

So normally, there is a Green layer, a White layer on top of it and then an Yellow layer on top of that.

Currently Yellow layer is on top. Now I animate the the RelativeLayout by rotating it across Y-axis about 180 degree. Ideally what I expect it that Green layer comes on top and Yellow goes to the back. But what I get is, the RelativeLayout rotates 180 degree but the Yellow layer still stays in the front.

So, what does a rotationY in RelativeLayout does? Does it only scales it from +1 to -1, to create an effect of rotation? How can I truly rotate the layout, to achieve the case I mentioned above?

Aucun commentaire:

Enregistrer un commentaire