信阳网站设计如何快速找到公司网站

news/2025/9/26 16:37:58/文章来源:
信阳网站设计,如何快速找到公司网站,飞鸽crm电销系统,哪家公司做企业网站今天我们就来学习逐帧动画,废话少说直接上效果图如下: 帧动画的实现方式有两种#xff1a; 一、在res/drawable文件夹下新建animation-list的XML实现帧动画 1、首先在res/drawable文件夹下添加img00-img24共25张图片 2、新建frame_anim.xml [html] view plaincopy ?xml v…今天我们就来学习逐帧动画,废话少说直接上效果图如下:     帧动画的实现方式有两种 一、在res/drawable文件夹下新建animation-list的XML实现帧动画 1、首先在res/drawable文件夹下添加img00-img24共25张图片 2、新建frame_anim.xml   [html] view plain copy ?xml version1.0 encodingutf-8?  animation-list xmlns:androidhttp://schemas.android.com/apk/res/android      android:oneshottrue         !-- animation-list 帧动画 --      !-- android:oneshot的值为 false代表播放多次true代表只播放一次 --      !-- duration代表每张图片的播放时间 ,定义一个持续时间为50毫秒的动画帧 --      item          android:drawabledrawable/img00          android:duration50/      item          android:drawabledrawable/img01          android:duration50/      item          android:drawabledrawable/img02          android:duration50/      item          android:drawabledrawable/img03          android:duration50/      item          android:drawabledrawable/img04          android:duration50/      item          android:drawabledrawable/img05          android:duration50/      item          android:drawabledrawable/img06          android:duration50/      item          android:drawabledrawable/img07          android:duration50/      item          android:drawabledrawable/img08          android:duration50/      item          android:drawabledrawable/img09          android:duration50/      item          android:drawabledrawable/img10          android:duration50/      item          android:drawabledrawable/img11          android:duration50/      item          android:drawabledrawable/img12          android:duration50/      item          android:drawabledrawable/img13          android:duration50/      item          android:drawabledrawable/img14          android:duration50/      item          android:drawabledrawable/img15          android:duration50/      item          android:drawabledrawable/img16          android:duration50/      item          android:drawabledrawable/img17          android:duration50/      item          android:drawabledrawable/img18          android:duration50/      item          android:drawabledrawable/img19          android:duration50/      item          android:drawabledrawable/img20          android:duration50/      item          android:drawabledrawable/img21          android:duration50/      item          android:drawabledrawable/img22          android:duration50/      item          android:drawabledrawable/img23          android:duration50/      item          android:drawabledrawable/img24          android:duration50/    /animation-list   3、在activity_main中添加控件     [html] view plain copy RelativeLayout xmlns:androidhttp://schemas.android.com/apk/res/android      xmlns:toolshttp://schemas.android.com/tools      android:layout_widthmatch_parent      android:layout_heightmatch_parent      tools:contextcom.havorld.frameanimation.MainActivity         ImageView          android:idid/imageView          android:layout_widthwrap_content          android:layout_heightwrap_content          android:layout_centerInParenttrue /      !-- android:backgrounddrawable/frame_anim --        LinearLayout          android:layout_widthmatch_parent          android:layout_heightwrap_content          android:layout_alignParentBottomtrue          android:orientationhorizontal          android:padding10dp             Button              android:idid/start              android:layout_width0dp              android:layout_heightwrap_content              android:layout_weight1              android:text播放 /            Button              android:idid/stop              android:layout_width0dp              android:layout_heightwrap_content              android:layout_weight1              android:text停止 /      /LinearLayout    /RelativeLayout   4、在代码中获取并开启帧动画     [java] view plain copy public class MainActivity extends Activity implements OnClickListener {        private ImageView imageView;      private AnimationDrawable animationDrawable;        Override      protected void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.activity_main);            imageView  (ImageView) findViewById(R.id.imageView);          findViewById(R.id.start).setOnClickListener(this);          findViewById(R.id.stop).setOnClickListener(this);            setXml2FrameAnim1();          // setXml2FrameAnim2();        }        /**      * 通过XML添加帧动画方法一      */      private void setXml2FrameAnim1() {            // 把动画资源设置为imageView的背景,也可直接在XML里面设置          imageView.setBackgroundResource(R.drawable.frame_anim);          animationDrawable  (AnimationDrawable) imageView.getBackground();      }        /**      * 通过XML添加帧动画方法二      */      private void setXml2FrameAnim2() {            // 通过逐帧动画的资源文件获得AnimationDrawable示例          animationDrawable  (AnimationDrawable) getResources().getDrawable(                  R.drawable.frame_anim);          imageView.setBackground(animationDrawable);      }         Override      public void onClick(View v) {            switch (v.getId()) {          case R.id.start:              if (animationDrawable ! null  !animationDrawable.isRunning()) {                  animationDrawable.start();              }              break;          case R.id.stop:              if (animationDrawable ! null  animationDrawable.isRunning()) {                  animationDrawable.stop();              }              break;            default:              break;          }      }    }   二、通过代码实现帧动画     [java] view plain copy /**  * 通过代码添加帧动画方法  */  private void setSrc2FrameAnim() {        animationDrawable  new AnimationDrawable();      // 为AnimationDrawable添加动画帧      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img00), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img01), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img02), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img03), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img04), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img05), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img06), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img07), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img08), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img09), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img10), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img11), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img12), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img13), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img14), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img15), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img16), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img17), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img18), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img19), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img20), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img21), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img22), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img23), 50);      animationDrawable.addFrame(              getResources().getDrawable(R.drawable.img24), 50);      // 设置为循环播放      animationDrawable.setOneShot(false);      imageView.setBackground(animationDrawable);  }     点击下载源码  转载于:https://www.cnblogs.com/Im-Victor/p/8760379.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/916976.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

详细介绍:SMTPman,smtp服务器的使用全解析与指南!

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

挑战用R语言硬干一百万单细胞数据分析 - 指南

挑战用R语言硬干一百万单细胞数据分析 - 指南pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", &qu…

WPF ListBox VirtualizingPanel.CacheLengthUnit=Item VirtualizingPanel.CacheLength=5,5

Install-Package Microsoft.Extensions.DependencyInjection; Totally speaking, VirtualizationPanel.CacheLengthUnits value is item and its performance is better than pixel, the latter may lead to Unpredic…

服务好的赣州网站建设上海缪斯设计公司

jquery修改选中状态的方法:1、使用addClass和removeClass方法,可以向选中的元素添加一个多个类名,从而改变其样式或状态;2、使用toggleClass方法,可以在选中元素上添加或移除一个类名,如果该类名已经存在&a…

呼叫中心开源社区专栏第一篇 - 详解

呼叫中心开源社区专栏第一篇 - 详解pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco…

完整教程:【设计模式】适配器模式

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

北京网站建设方案系统网络平台代理

1.首先创建boot分区(200M即可) boot分区作为linux启动相关信息的存储介质,不论boot分区什么时候,它都会排在整个硬盘的起始段,方便系统启动获取相关信息,用户尽量不去更改boot分区的挂载点顺序。 2.接着创建swap分区(应…

原核表达可溶性蛋白难题破解

原核表达可溶性蛋白难题破解在生物医药、疫苗研发、结构生物学和酶工程等领域,重组蛋白的表达与纯化是基础性技术之一。其中,原核表达系统因其高效、成本低廉而成为研究和工业生产中的首选平台。然而,如何获得高可溶…

深入解析:Adobe Fresco下载教程Adobe Fresco 2025保姆级安装步骤(附安装包)

深入解析:Adobe Fresco下载教程Adobe Fresco 2025保姆级安装步骤(附安装包)pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-fa…

做外贸网站信息怎么让网站收录

一级缓存 Mybatis对缓存提供支持,但是在没有配置的默认情况下,它只开启一级缓存,一级缓存只是相对于同一个SqlSession而言。所以在参数和SQL完全一样的情况下,我们使用同一个SqlSession对象调用一个Mapper方法,往往只执…

如何向搜索引擎提交网站seo 网站改版

一、projecrion函数 题目:projecrion函数中的第一个参数fov和第二个参数ratio参数进行实验。看能否搞懂它们是如何影响透视平截头体的。 当ratio不变,fov值变大,显示的物体会变小;当fov不变,radio值变大,…

Torch中的tensor size

本文重点介绍了一下如何在PyTorch中去计算一个高维tensor的大小,也就是元素的总数。在其他框架中我们需要使用size函数来获取,而在PyTorch框架中这个接口被调整为numel,本文给出了两个具体代码示例。技术背景 其实对…

深入解析:贪心算法之船舶装载问题

深入解析:贪心算法之船舶装载问题pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco&…

Codeforces 1053 (Div.2)

Codeforces 1053 (Div.2)Codeforces 1053 (Div.2) C. Incremental Stay 题意: 有n个人,存在2*n个时刻,分配这2n个时刻给予n个人进出的时间,输出当博物馆容量为(1-n)时,这些人呆在博物馆的总时长最大值 思路: 对于\…

抗体药物偶联物(ADCs)生物分析:拆解 “靶向导弹” 体内轨迹的核心技术

在肿瘤治疗领域,抗体药物偶联物(ADCs)堪称 “精准导弹”—— 凭借抗体的靶向性将细胞毒性载荷递送至肿瘤细胞,既突破了传统化疗的非特异性毒性,又解决了部分抗体药物疗效不足的问题。截至 2024 年,全球已有十余款…

深入解析:文献阅读 | iMetaMed | FigureYa:一个标准化可视化框架,用于增强生物医学数据解释和研究效率

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

spring boot方案利用Torna生成在线接口文档

spring boot方案利用Torna生成在线接口文档pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "…

C#关键字 unchecked与checked - 教程

C#关键字 unchecked与checked - 教程2025-09-25 12:22 tlnshuju 阅读(0) 评论(0) 收藏 举报pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !im…

做营销型网站的教程网站建设方案论文1500

6,BGP的基本配置 1,BGP建邻的基本关系 1,EBGP对等体关系直接建邻 [r1]bgp 1----启动BGP进程---后面的1不是进程号,而是配置路由器所在AS的AS号 [r1-bgp] [r1-bgp]router-id 1.1.1.1---配置RID [r1-bgp]peer 12.0.0.2 as-number-…

网站建设分析徐州整站优化

shell的模拟实现 我们知道shell是一个永不退出的程序,所以他应该是一个死循环,并且shell为了防止影响到自己,我们在命令行上输入的所有命令都是由shell的子进程来执行的,所以它应该要有创建子进程的相关函数,当然也会…