zoukankan      html  css  js  c++  java
  • Splash闪屏页-三种动画效果

    三种动画效果

    旋转 RotateAnimation

    缩放 ScaleAnimation

    渐变 AlphaAnimation

    动画效果集合 

    AnimationSet

     1 // 初始化欢迎页面的动画
     2 
     3 private void initViews(){
     4 
     5       RelativeLayout rlRoot = (RelativeLayout) findViewById(R.id.rl_root);    
     6 
     7       RotateAnimation rotate  = new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
     8       rotate.setDuration(1000);//动画执行的时间
     9       rotate.setFillAfter(true);//动画结束后保持最终状态
    10 
    11       ScaleAnimation scale = new ScaleAnimation(0,1,0,1,,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
    12       scale.setDuration(1000);
    13       scale.setFillAfter(true);
    14 
    15       AlphaAnimation alpha = new AlphaAnimation(0,1);
    16       alpha.setDuration(1000);
    17       alpha.setFillAfter(true);
    18 
    19       AnimationSet set = new AnimationSet(false);
    20       set.addAnimation(rotate);
    21       set.addAnimation(scale);
    22       set.addAnimation(alpha);
    23       
    24       rlRoot.startAnimation(set);   
    25         
    26 }                          
  • 相关阅读:
    L1-021 重要的话说三遍
    L1-020 帅到没朋友
    pytest--钩子
    pytest--allure
    pytest--常用插件
    pytest--高级用法
    pytest--配置文件
    pytest--控制运行
    pytest--fixture
    pytest--使用前提
  • 原文地址:https://www.cnblogs.com/lude313/p/4855438.html
Copyright © 2011-2022 走看看