2016-07-07 89 views
0

我想向用户展示3D封闭的滚动纸张,他们可以用手指展开什么。什么是最好的方式来做到这一点?Android - 如何做一个可触摸的滚动纸张动画?

+0

有没有一个例子可以链接来说明这一点?你有没有看过什么呢? –

+0

类似这样的:https://www.youtube.com/watch?v=JWy_ZD4pJMk – Peter

回答

1

要达到像你想要的的影响,你需要第一件事是平面设计师

你需要两个特别的图形资源:

  1. 完整的图像没有底部滚动部分的铺开羊皮纸
  2. 羊皮纸的底部 - 为此,您将需要多个框架(以使滚动成为动画)。所以你需要每帧滚动动画1张图片。

一旦你有了这些资产,你需要正确地布置它们。

我会推荐这样的布局(伪布局):

<LinearLayout - vertical, this will be your main container> 
    <RelativeLayout - will start at a small height, and will grow with animation. Should crop children> 
     <ImageView - with the top & center part of the parchment 
        - give this view an explicit height which is equal to the fully 
        extended size of the parent layout/> 
     <... any additional layouts or views /> 
    </RelativeLayout> 
    <ImageView - contains a single frame of the rolling bottom part 
       - replace the image with the next frame every few milliseconds/> 
</LinearLayout> 

概念上讲,这应该足以获得你想要的效果。

道歉的答案的抽象性,但由于你没有发布任何你试过的代码(我假设你还没有尝试过),对我来说没有太多跟...共事。

希望这会给你足够的想法让你开始。

+0

谢谢,我会检查出来。是的,我还没有做任何事情,因为我不知道如何开始。感谢您的帮助,谢谢。 – Peter

+0

有没有任何教程会有帮助? – Peter

+0

这将很难找到一个涵盖这个特定需求的教程。这完全是关于如何了解你拥有的工具,以及如何使用它们来获得你需要的地方。 –