ppablog

1、设置动画布局文件(在drawable中添加xml文件)

    <?xml version="1.0" encoding="utf-8"?>

<animation-list xmlns:android="http://schemas.android.com/apk/res/android" 

    android:oneshot="true">

    <item android:drawable="@drawable/p1" android:duration="200"/>

     <item android:drawable="@drawable/p2" android:duration="200"/>

      <item android:drawable="@drawable/p3" android:duration="200"/>

       <item android:drawable="@drawable/p4" android:duration="200"/>

        <item android:drawable="@drawable/p5" android:duration="200"/>

         <item android:drawable="@drawable/p6" android:duration="200"/>

</animation-list>


2、播放动画

 //设置开机动画
ImageView iv=(ImageView) findViewById(R.id.iv);
iv.setBackgroundResource(R.drawable.start_animation);
AnimationDrawable ad=(AnimationDrawable) iv.getBackground();
ad.start();

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-05
  • 2021-10-15
  • 2021-11-27
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-23
  • 2021-05-14
  • 2021-06-22
  • 2022-12-23
  • 2021-10-09
相关资源
相似解决方案