1.介绍

补间动画开发者只需指定动画开始,以及动画结束"关键帧", 而动画变化的"中间帧"则由系统计算并补齐!

2.去掉App的标题

(1)将AndroidManifest文件中Application标签中内容保持不变。

android:theme="@style/AppTheme"(即默认设置).

(2)修改values->styles.xml中的设置

将以下内容:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

替换为:

<resources>

    <!-- Base application theme. -->
<!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style> </resources>

3.修改应用显示的图标

AndroidManifest文件中,将以下代码进行修改。

(1)修改前

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

(2)修改后

<application
android:allowBackup="true"
android:icon="@mipmap/icon_150"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

4.XML布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"> <Button
android:id="@+id/bt_touming"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="透明" /> <Button
android:id="@+id/bt_xuanzhuan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="旋转" /> <Button
android:id="@+id/bt_suofang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="缩放" /> </LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"> <ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@mipmap/ic_launcher" />
</LinearLayout>
</LinearLayout>

5.java后台

package com.example.administrator.test60donghua;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.widget.Button;
import android.widget.ImageView; public class MainActivity extends AppCompatActivity { Button bt_touming;
Button bt_xuanzhuan;
Button bt_suofang;
ImageView iv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bt_touming=findViewById(R.id.bt_touming);
bt_xuanzhuan=findViewById(R.id.bt_xuanzhuan);
bt_suofang=findViewById(R.id.bt_suofang);
iv=findViewById(R.id.imageView); //透明动画
bt_touming.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//创建透明动画,1.0为完全不透明,0.0为完全透明
AlphaAnimation aa=new AlphaAnimation(1.0f,0.0f);
aa.setDuration(2000);//设置动画执行的时间
aa.setRepeatCount(1); //设置动画重复的次数
aa.setRepeatMode(Animation.REVERSE); //设置重复的模式
iv.startAnimation(aa); //开始执行动画
}
}); //旋转效果
bt_xuanzhuan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RotateAnimation ra=new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
ra.setDuration(2000);//设置动画执行的时间
ra.setRepeatCount(1); //设置动画重复的次数
ra.setRepeatMode(Animation.REVERSE); //设置重复的模式
iv.startAnimation(ra); //开始执行动画
}
}); bt_suofang.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ScaleAnimation sa=new ScaleAnimation(1.0f,2.0f,1.0f,2.0f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
sa.setDuration(2000);//设置动画执行的时间
sa.setRepeatCount(1); //设置动画重复的次数
sa.setRepeatMode(Animation.REVERSE); //设置重复的模式
iv.startAnimation(sa); //开始执行动画
}
}); }
}

6.效果图

012 Android 动画效果(补间动画) +去掉App默认自带的标题+更改应用的图标的更多相关文章

  1. View动画(补间动画)

    补间动画的属性 Animation的属性 JAVA方法 XML属性 解释 setDetachWallpaper(boolean) android:detachWallpaper 是否在壁纸上运行 se ...

  2. Android动画总结#补间动画(Tween Animation/View Animation) #帧动画(Frame Animation/Drawable Animation)#属性动画(PropertyAnimation)

    1.共有三种动画,英文名字多种叫法如下 第一种动画:补间动画(Tween Animation/View Animation) 四个:RotateAnimation旋转. AlphaAnimation透 ...

  3. Android开发(26)--补间动画(Tween)的实现

    补间动画(Tween Animation) 补间动画与逐帧动画在本质上是不同的,逐帧动画通过连续播放图片来模拟动画的效果,而补间动画则是通过在两个关键帧之间补充渐变的动画效果来实现的.补间动画的优点是 ...

  4. Android中的帧动画与补间动画的使用

    前言 在日常开发中,我们有时候须要一些好看的动画效果,这时能够充分利用Android提供的这几种动画来实现. Android提供了3种类型的动画: 补间动画:补间动画能够应用于View,让你能够定义一 ...

  5. Android动画系列之帧动画和补间动画

    原文首发于微信公众号:jzman-blog,欢迎关注交流! Android 提供三种动画:帧动画.补间动画和属性动画,本篇文章介绍帧动画以及补间动画的使用,属性动画的使用将在后面的文章中分享,那就来复 ...

  6. android104 帧动画,补间动画,属性动画

    ##帧动画FrameAnimation* 多张图片快速切换,形成动画效果* 帧动画使用xml定义 package com.itheima.frameanimation; import android. ...

  7. Android 深入ViewPager补间动画,实现类京东商城首页广告Banner切换效果

    如有转载,请声明出处: 时之沙: http://blog.csdn.net/t12x3456 某天看到京东商城首页的滑动广告的Banner,在流动切换的时候有立体的动画效果,感觉很有意思,然后研究了下 ...

  8. Android开发之补间动画、XML方式定义补间动画

    四种补间动画: 1.透明: 2.缩放: 3.位移: 4.旋转: //点击按钮 实现iv 透明的效果 动画 public void click1(View v) { //1.0意味着着完全不透明 0.0 ...

  9. android 学习随笔二十五(动画:补间动画)

    补间动画(TweenAnimation) * 原形态变成新形态时为了过渡变形过程,生成的动画就叫补间动画(为了让对象从初始状态向结束状态改变的过程更加自然而自动生成的动画效果)* 位移.旋转.缩放.透 ...

随机推荐

  1. [luogu 3803]【模板】多项式乘法

    传送门 FFT #include<bits/stdc++.h> #define ll long long #define max(a,b) ((a)>(b)?(a):(b)) #de ...

  2. Intellij IDEA 从入门到上瘾 图文教程

    1. IDEA VS Eclipse 核心术语比较 ​ 由下图可见:两者最大的转变就在于工作空间概念的转变,并且在IDEA当中,Project和 Module是作为两个不同的概念,对项目结构是具有重大 ...

  3. hive 属性随笔记录

    set hive.mapred.mode=strict; //设置hive执行模式,默认为nonstrict(非严格模式),这里设置为严格模式 set hiveconf:hive.cli.print. ...

  4. 小程序弹框wx.showModal的使用

    if (!logined) { wx.showModal({ title: '提示', content: '您还没登录登录车掌柜, 是否前往登录', confirmText: '前往登录', conf ...

  5. DM当中用文本输入点【转载】

    摘自<ANSYS 13.0 Workbench数值模拟技术> 通过XYZ坐标的文本文件创建3D曲线,文本需要满足一定的格式,格式化文本中,#表示此行是注释,忽略空行,数据行包括5个数据域, ...

  6. 找到树中指定id的所有父节点

    const data = [{ id: 1, children: [{ id: 2, children: [{ id: 3, }, { id: 4, }], }], }, { id: 5, child ...

  7. Redis 3.2.100 配置注意

    新装服务器外网连接报错 /Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstandin ...

  8. Anaconda3自带jupyter

    1.cmd命令行中输入 JupyterNotebook 2.系统自动调起下面页面(注册端口冲突是打不开的)

  9. flask 设置访问地址 和 访问端口

    app.run() 四个参数 host:主机,可设置为本地或其他IP port:端口,是run()启动服务的时候指定的运行端口, debug:调试,如果需要进入调试模式,可以将这个选项设置成True ...

  10. 【idea】断点调试时查看所有变量和静态变量

    转载至博客:https://blog.csdn.net/qq32933432/article/details/86672341 缘起 笔者在进行HashMap原理探索的时候需要在IntelliJ ID ...