闪屏不适用于导航抽屉

时间:2017-04-02 11:41:55

标签: navigation drawer splash

导航抽屉工作正常,但是当我将启动画面添加到我的项目时它无法正常工作

splasScreen

清单

4 个答案:

答案 0 :(得分:2)

我花了一段时间才解决这个问题。

Android Manifest中的主要活动应该如下所示

Android Manifest上的活动部分应如下所示: Note the MainActive Theme

<activity
  android:name=".MainActivity"
  android:label="@string/title_activity_main"
  android:theme="@style/AppTheme.NoActionBar">
</activity>

答案 1 :(得分:0)

var input = "thinking [ of using ] BBCode format [A=16] and [E=2] here [V=8] and so on";

var pattern = @"^(?:(.*?)(\[[AEV]=\d+\]))*(.*?)$";

var match = Regex.Match(input, pattern);

答案 2 :(得分:0)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nulledapps.website2app">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".SplashScreen"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MainActivity"></activity>
    </application>

</manifest>

答案 3 :(得分:0)

此代码适用于我,请尝试:D

SplashScreen.java代码:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash_screen);

    new Thread() {
        public void run() {
            try {
                sleep(3000);
                startActivity(new Intent(SplashScreen.this, MainActivity.class));
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }.start();
}

}

AndroidManiffest.xml代码:

<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".SplashScreen"
        android:label="TEST"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".MainActivity"
        android:label="TEST"
        android:theme="@style/AppTheme.NoActionBar">
    </activity>
</application>