当前位置:操作系统 > 安卓/Android >>

我的Android进阶之旅------>Android之动画之Frame Animation实例

Frame animation
An animation defined in XML that shows a sequence of images in order (like a film).
 
FILE LOCATION:
res/drawable/filename.xml
The filename will be used as the resource ID.
COMPILED RESOURCE DATATYPE:
Resource pointer to an AnimationDrawable.
RESOURCE REFERENCE:
In Java: R.drawable.filename
In XML: @[package:]drawable.filename
SYNTAX:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot=["true" | "false"] >
    <item
        android:drawable="@[package:]drawable/drawable_resource_name"
        android:duration="integer" />
</animation-list>
ELEMENTS:
<animation-list>
Required. This must be the root element. Contains one or more <item> elements.
attributes:
 
android:oneshot
Boolean. "true" if you want to perform the animation once; "false" to loop the animation.
<item>
A single frame of animation. Must be a child of a <animation-list> element.
attributes:
 
android:drawable
Drawable resource. The drawable to use for this frame.
android:duration
Integer. The duration to show this frame, in milliseconds.
 
补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,