启动页的一种简单动画
来源:互联网 发布:乐高机器人编程程序 编辑:程序博客网 时间:2024/05/29 08:56
利用补间动画中的一个alphaAnimation动画:public class MainActivity extends Activity {private ImageView ivlogin;private Button loginBtn;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);ivlogin = (ImageView) findViewById(R.id.iv_login);loginBtn = (Button) findViewById(R.id.btn_begin);AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);alphaAnimation.setDuration(3000);alphaAnimation.setFillAfter(true);ivlogin.startAnimation(alphaAnimation);loginBtn.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {Intent intent = new Intent(MainActivity.this,HomeActivity.class);startActivity(intent);MainActivity.this.finish();}}); }}
布局很简单,如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <ImageView android:id="@+id/iv_login" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerVertical="true" android:scaleType="fitXY" android:src="@drawable/launch" /> <Button android:id="@+id/btn_begin" android:layout_width="wrap_content" android:layout_height="46dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="30dp" android:background="@drawable/afs" android:text="@string/login_btn_begin" > </Button></RelativeLayout>
1 0
- 启动页的一种简单动画
- 实现启动动画的一种方法
- 一种简单的缓冲动画函数实现
- 简单的启动页滑动动画,下面带圆点的切换
- Web页面中实现简单动画的一种方法
- activity之间切换动画一种简单方法
- 一种加载动画的实现
- [Android][UI]模拟器启动界面动画效果的简单实现
- 一种简单有效的3D模型的动画多线程方案
- 一种简单有效的3D模型的动画多线程方案
- 一种简单有效的3D模型的动画多线程方案
- 一种简单有效的3D模型的动画多线程方案
- 一种简单有效的3D模型的动画多线程方案
- 一种简单有效的3D模型的动画多线程方案
- 一种简单的加密算法
- cocos2d一种动画的快方法
- 一种可行的系列动画播放方式
- 一种可行的系列动画播放方式
- 产品经理如何做好需求过滤——一数据
- 对继承理解以及虚析构函数的理解
- 使用myeclipse构建maven web项目
- 容器的性能监控和日志管理
- Ionic开发环境搭建
- 启动页的一种简单动画
- triplet loss 原理以及梯度推导
- 利用jQuery的ajax点击ztree节点把json里面的数据放到指定的div中
- 警示
- C#判断字符串是否是数字字符串
- JAVA反射小案例
- windows环境下安装 mysql
- java 学习第五节---内置数据类型
- STL vector用法介绍