标签:config protect 内容 holo prot led 启动画面 bit finish
1、将启动图片保存到Drawable文件夹下
2、在Drawable文件夹下创建splashscreen.xml
<?xml version="1.0" encoding="utf-8" ?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/splash_screen" android:gravity="fill" android:layout_gravity="center"/>
3、在android项目的 Resources 文件夹下添加“Values”文件夹,创建 Styles.xml,设置其创建内容如下:
<?xml version="1.0" encoding="utf-8" ?> <resources> <style name="Theme.Splash" parent="android:Theme.Holo.Light"> <item name="android:windowBackground">@drawable/splashscreen</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsTranslucent">false</item> <item name="android:windowIsFloating">false</item> <item name="android:backgroundDimEnabled">true</item> </style> </resources>
4、在Android项目下创建一个SplashScreen.cs类
[Activity(MainLauncher = true, NoHistory = true, Theme = "@style/Theme.Splash", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class SplashScreen : Activity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var intent = new Intent(this, typeof(MainActivity)); StartActivity(intent); Finish(); } }
标签:config protect 内容 holo prot led 启动画面 bit finish
原文地址:https://www.cnblogs.com/sunguanbin/p/11217355.html