博客
关于我
Android 实现欢迎界面
阅读量:116 次
发布时间:2019-02-26

本文共 1439 字,大约阅读时间需要 4 分钟。

文章目录


前言

好久没发博客了,最近太忙了


提示:以下是本篇文章正文内容,下面案例可供参考

一、欢迎页

代码如下(示例):

public class WelcomeMainActivity extends AppCompatActivity {       @Override    protected void onCreate(Bundle savedInstanceState) {           super.onCreate(savedInstanceState);        setContentView(R.layout.activity_welcome_main);        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);//隐藏状态栏        getSupportActionBar().hide();//隐藏标题栏        //\实现改功能可以使用以下4种方式        //1.sleep() 2.handler 发送延迟消息 3.Timer类  4.使用动画\        //使用动画实现  alpha:透明  利用0.7f到1.0f过渡的过程中制造几秒的停顿        ObjectAnimator animator = ObjectAnimator.ofFloat(findViewById(R.id.welcome_img),"alpha",0.7f,1.0f);        //设置动画执行时间        animator.setDuration(2000);        //动画启动        animator.start();        //监听动画是否结束        animator.addListener(new AnimatorListenerAdapter() {               @Override            public void onAnimationEnd(Animator animation) {                   super.onAnimationEnd(animation);                startActivity(new Intent(WelcomeMainActivity.this,MainActivity.class));            }        });    }}

XML中的代码就设置了一张图片

<ImageView    xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:id="@+id/welcome_img"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:src="@drawable/welcome"    tools:context=".WelcomeMainActivity"/>

总结

以上就是欢迎页的实现了.如果有误的东西,我会尽量去改的

转载地址:http://akok.baihongyu.com/

你可能感兴趣的文章
mysql-group_concat
查看>>
MySQL-redo日志
查看>>
MySQL-【1】配置
查看>>
MySQL-【4】基本操作
查看>>
Mysql-丢失更新
查看>>
Mysql-事务阻塞
查看>>
Mysql-存储引擎
查看>>
mysql-开启慢查询&所有操作记录日志
查看>>
MySQL-数据目录
查看>>
MySQL-数据页的结构
查看>>
MySQL-架构篇
查看>>
MySQL-索引的分类(聚簇索引、二级索引、联合索引)
查看>>
Mysql-触发器及创建触发器失败原因
查看>>
MySQL-连接
查看>>
mysql-递归查询(二)
查看>>
MySQL5.1安装
查看>>
mysql5.5和5.6版本间的坑
查看>>
mysql5.5最简安装教程
查看>>
mysql5.6 TIME,DATETIME,TIMESTAMP
查看>>
mysql5.6.21重置数据库的root密码
查看>>