本文主要是介绍闪屏页的正确方式,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:drawable="@color/gray"/><item><bitmapandroid:gravity="center"android:src="@mipmap/ic_launcher"/></item>
</layer-list>
<resources><!-- Base application theme. --><style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"><!-- Customize your theme here. --></style><style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"><item name="android:windowBackground">@drawable/background_splash</item></style></resources>
<activityandroid:name=".SplashActivity"android:theme="@style/SplashTheme"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter> </activity>
public class SplashActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);Intent intent = new Intent(this, MainActivity.class);startActivity(intent);finish();} }
这篇关于闪屏页的正确方式的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!