Android启动画面实现
16lz
2021-12-04
Android应用程序启动之后需要一个Splash启动界面,显示产品LOGO、公司LOGO等等,提高用户体验。
1.splash.xml布局文件
1 2 3 4 5 6 7 8 910111213 | |
2.SplashActivity类,使用Handler的postDelayed方法,3秒后执行跳转到主视图
1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031323334353637383940414243 | package cn.eoe.leigo.splash;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;/** * * @{#} SplashActivity.java Create on 2013-5-2 下午9:10:01 * * class desc: 启动画面 * * |
3.配置AndroidManifest.xml
1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930 | <?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cn.eoe.leigo.splash" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" /> <application android:icon="@drawable/logo" android:label="@string/app_name" > <activity android:name=".SplashActivity" android:configChanges="keyboardHidden" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> intent-filter> activity> <activity android:name=".MainActivity" /> application>manifest> |
这样在启动页中this.requestWindowFeature(Window.FEATURE_NO_TITLE);这样就达到了启动图全屏显示了
更多相关文章
- Android(安卓)7.0 SystemUI(1)--启动过程
- AbstractProcessor注解处理器
- 编译android源码6---运行android编译源码
- Android(安卓)系统服务 - PMS 的启动过程
- Android(安卓)系统状态栏一体化
- Android(安卓)Adapter详解
- Android在开机时自动启动一个应用程序
- android音乐播放器Service的生命周期分析
- android 自定义ratingbar 图片显示不全的解决方案