你好,游客 登录 注册 搜索
背景:
阅读新闻

Android范例animation代码片段

[日期:2013-01-24] 来源:Linux社区  作者:bawang_cn [字体:大 中 小]

如下是xml文件:

<FrameLayout xmlns:Android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ListView
        android:id="@android:id/list"
        android:persistentDrawingCache="animation|scrolling"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layoutAnimation="@anim/layout_bottom_to_top_slide" />

    <ImageView
        android:id="@+id/picture"
        android:scaleType="fitCenter"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="gone" />

</FrameLayout>

简单分析:程序完成初始化,初始化listview 和imageview,刚开始imageview不可见,所以如果点击listitem,则 调用 applyRotation(position, 0, 90);  具体作用:Setup a new 3D rotation on the container view,然后会有一个监听动画的监听器,如下: rotation.setAnimationListener(new DisplayNextView(position));,等动画上半部分完成,会进入下半部分:mContainer.post(new SwapViews(mPosition));    如此完成动画过程。

linux
相关资讯       Android animation  Android范例  Android代码 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款