3

First of all I am completely new to animation on android but would like to include it in my next application. The application will be as follows:

For example, I will be having 2 layers, each one containing their own data.

Layer 1 will contain data 1

Layer 2 will contain data 2

And layer 1 will be superimposed on layer 2; that is on top of layer 2.

Layer 1 will be over layer 2 and thus masking/hiding layer 2

When a button is clicked (with intention to show layer 2), layer 1 will slide out and revealing layer 2. And another button will allow layer 1 to slide back in again.

Note that I used the word layers to give a general image of what I am trying to achieve. I do not really know which elements are used in animation for android since I did not come across any layout elements that can be superimposed on each over yet.

Also, how I am thinking it right now is that those so called layers will be in a linearlayout.

So my question is how can I achieve this?What elements/objects/library should I be using?And of course links to some documentation and tutorials are more than welcomed.

Thank you.

4

2 回答 2

2

Try starting by looking at ViewFlipper and taking a look at this tutorial on animating a ViewFlipper to get an idea of how something similar was accomplished.

于 2010-09-14T13:31:52.273 回答
0

如果您要在 android 游戏中实现这种滑动行为,那么使用游戏引擎会更有效率。价值在于它为您处理幻灯片动画,并且您可以在一行代码中为整个游戏层(填充有子元素)设置动画,例如 layer.MoveTo(newPositionOutsideScreen)。我推荐适用于 android 的 cocos2d,您可以找到有关构建滑块拼图的详细教程,以帮助您入门..

http://denvycom.com/blog/step-by-step-guide-on-how-to-build-your-first-slider-puzzle-game-in-cocos2d-for-android-part-1/

于 2014-03-28T20:51:19.787 回答